File tree Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Expand file tree Collapse file tree 2 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ "use client" 
2+ import  { useEffect }  from  "react" ; 
3+ import  { RegistrationRest }  from  "../../rest/RegistrationRest" ; 
4+ import  { Box ,  CircularProgress ,  Typography }  from  "@mui/material" ; 
5+ import  { useRouter }  from  "next/navigation" ; 
6+ 
7+ export  default  function  Page ( )  { 
8+ 
9+     const  router  =  useRouter ( ) 
10+ 
11+     useEffect ( ( )  =>  { 
12+         if  ( typeof  window  !==  'undefined' )  { 
13+             const  queryParameters  =  new  URLSearchParams ( window ?. location ?. search ) 
14+             const  token  =  queryParameters . get ( "t" ) 
15+             const  registration  =  queryParameters . get ( "r" ) 
16+             const  registrationRest  =  new  RegistrationRest ( ) 
17+             registrationRest . acceptWithToken ( registration ,  token ) . then ( ( )  =>  router . push ( "/?isVerified=true" ) ) 
18+         } 
19+ 
20+     } ,  [ ] ) ; 
21+     return  < Box  sx = { { padding : 10 ,  display : "flex" ,  justifyContent : "center" } } > 
22+         < Box  > 
23+             < CircularProgress  color = { "inherit" } /> 
24+             < Typography > Verifying your Token</ Typography > 
25+         </ Box > 
26+     </ Box > 
27+ } 
Original file line number Diff line number Diff line change @@ -8,4 +8,8 @@ export class RegistrationRest{
88        return  axios . post ( this . baseUrl + "/registration" ,  data ) 
99    } 
1010
11+     acceptWithToken ( registrationId ,  token )  { 
12+         return  axios . post ( `${ this . baseUrl } ${ registrationId } ${ token }  ) ; 
13+     } 
14+ 
1115} 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments