File tree Expand file tree Collapse file tree 4 files changed +21
-7
lines changed Expand file tree Collapse file tree 4 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import {useEffect} from "react";
33import { RegistrationRest } from "../../rest/RegistrationRest" ;
44import { Box , CircularProgress , Typography } from "@mui/material" ;
55import { useRouter } from "next/navigation" ;
6+ import { ParticipantRest } from "../../rest/ParticipantRest" ;
67
78export 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+ }
Original file line number Diff line number Diff 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 } )
Original file line number Diff line number Diff line change 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+ }
Original file line number Diff line number Diff line change 11import axios from "axios" ;
22
33export 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 )
You can’t perform that action at this time.
0 commit comments