Skip to content

Commit 3d70745

Browse files
committed
Updates verification
1 parent 1eb7fec commit 3d70745

File tree

4 files changed

+21
-7
lines changed

4 files changed

+21
-7
lines changed

src/app/verify/page.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {useEffect} from "react";
33
import {RegistrationRest} from "../../rest/RegistrationRest";
44
import {Box, CircularProgress, Typography} from "@mui/material";
55
import {useRouter} from "next/navigation";
6+
import {ParticipantRest} from "../../rest/ParticipantRest";
67

78
export default function Page() {
89

@@ -11,9 +12,10 @@ export default function Page() {
1112
useEffect(() => {
1213
if (typeof window !== 'undefined') {
1314
const queryParameters = new URLSearchParams(window?.location?.search)
14-
const type = queryParameters.get("token")
15-
const registrationRest = new RegistrationRest()
16-
registrationRest.verifyToken(type).then(() => router.push("/?isVerified=true"))
15+
const token = queryParameters.get("t")
16+
const participant = queryParameters.get("p")
17+
const participantRest = new ParticipantRest()
18+
participantRest.verifyToken(participant, token).then(() => router.push("/?isVerified=true"))
1719
}
1820

1921
}, []);
@@ -23,4 +25,4 @@ export default function Page() {
2325
<Typography>Verifying your Token</Typography>
2426
</Box>
2527
</Box>
26-
}
28+
}

src/components/Registration/Registration.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,8 @@ function Registration() {
439439
email: values.email,
440440
fieldData: JSON.stringify(values),
441441
signUpForm: {
442-
id: "283db119-046c-4418-939d-ab9bee06c996",
442+
//id: "283db119-046c-4418-939d-ab9bee06c996",
443+
id: "2f1c60f2-f30b-4432-8129-9131c6e398dd",
443444
},
444445
group: values.group,
445446
})

src/rest/ParticipantRest.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import axios from "axios";
2+
3+
export class ParticipantRest {
4+
//baseUrl = "https://pems-api.hackhpi.org/v1";
5+
6+
baseUrl = "http://localhost:8080/v1/participant";
7+
8+
verifyToken(participantId, token) {
9+
return axios.post(`${this.baseUrl}/id/${participantId}/verify/token/${token}`);
10+
}
11+
}

src/rest/RegistrationRest.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import axios from "axios";
22

33
export class RegistrationRest{
4-
baseUrl = "https://pems-api.hackhpi.org/v1";
5-
//baseUrl = "http://localhost:8080/v1";
4+
//baseUrl = "https://pems-api.hackhpi.org/v1";
5+
baseUrl = "http://localhost:8080/v1";
66

77
addRegistration(data){
88
return axios.post(this.baseUrl+"/registration", data)

0 commit comments

Comments
 (0)