This repository has been archived by the owner on Jan 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #242 from SCCapstone/152-Springbootmail-user-verif…
…ication verify.tsx didn't get pushed in last commit
- Loading branch information
Showing
2 changed files
with
120 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
.MP { | ||
text-align: center; | ||
} | ||
|
||
.MP-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
.MP-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
} | ||
|
||
@keyframes MP-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
import './Verify.css'; | ||
|
||
import { | ||
IonApp, | ||
IonButton, | ||
IonCard, | ||
IonCardContent, | ||
IonCardHeader, | ||
IonCardSubtitle, | ||
IonCardTitle, | ||
IonCol, | ||
IonContent, | ||
IonGrid, | ||
IonLabel, | ||
IonPage, | ||
IonRouterLink, | ||
IonRow, | ||
IonText, | ||
} from '@ionic/react'; | ||
|
||
import { Link, Router, Switch } from "react-router-dom"; | ||
import history from '../History'; | ||
import SideBar from '../components/SideBar'; | ||
import Header from '../components/Header'; | ||
|
||
import { useContext, useEffect, useState } from 'react'; | ||
import Context from '../components/Context'; | ||
import React from 'react'; | ||
import { verify } from 'crypto'; | ||
import axios from 'axios'; | ||
|
||
// const DOMAIN = "https://api.fridger.recipes" | ||
const DOMAIN = "http://localhost:8080/" | ||
|
||
//This is the page the email verifiction will send you to | ||
function Verify() { | ||
const context = useContext(Context); | ||
|
||
const queryParam = new URLSearchParams(window.location.search); | ||
const code = queryParam.get("code"); | ||
|
||
let runIt = 0; | ||
console.log(code); | ||
|
||
let hasChanged = false; | ||
|
||
interface retString { | ||
success: boolean | ||
} | ||
|
||
//D7dsErtnwX2OhXKPSCNtKquf57WLGL53ILolnoEFRCgPIfVaY34UqFjyjbswsvsQ | ||
|
||
function reDirect(ms: number) { | ||
return new Promise( resolve => setTimeout(resolve, ms) ); | ||
} | ||
|
||
const [stringBody, setStringBody] = React.useState<retString>({ | ||
success: false | ||
}); | ||
// useEffect(() => { | ||
// The link you are emailed will send you here | ||
const getVerified = () => { | ||
fetch(DOMAIN+`v1/auth/verify?code=${code}`) | ||
.then(data => data.json()) | ||
.then(yo => setStringBody(yo)); | ||
console.log(stringBody) | ||
|
||
} | ||
useEffect(() => { | ||
getVerified(); | ||
}, [hasChanged]) | ||
|
||
//this means verifiation is successful! | ||
return ( | ||
<Router history={history}> | ||
<Switch> | ||
<IonApp> | ||
<SideBar/> | ||
<IonPage className="ion-page" id="main-content"> | ||
<Header/> | ||
<IonContent className="ion-padding"> | ||
<h1>Thank you for verifiying your account! Your account has now been activated!</h1> | ||
</IonContent> | ||
</IonPage> | ||
</IonApp> | ||
</Switch> | ||
</Router> | ||
) | ||
|
||
} | ||
|
||
export default Verify; |