-
Notifications
You must be signed in to change notification settings - Fork 2
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 #95 from VAuthenticator/split-pages-with-react-rou…
…ter-in-dedicated-pages split pages
- Loading branch information
Showing
14 changed files
with
152 additions
and
148 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
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
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
63 changes: 63 additions & 0 deletions
63
src/main/frontend/app/reset-password/ResetPasswordChallengeSenderPage.js
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,63 @@ | ||
import ReactDOM from "react-dom"; | ||
import React from "react"; | ||
import {Box, Divider, Grid, ThemeProvider, Typography} from "@mui/material"; | ||
import theme from "../component/styles"; | ||
import Template from "../component/Template"; | ||
import {Person, VpnKey} from "@mui/icons-material"; | ||
import FormInputTextField from "../component/FormInputTextField"; | ||
import Separator from "../component/Separator"; | ||
import FormButton from "../component/FormButton"; | ||
|
||
|
||
const ResetPasswordChallengeSender = (props) => { | ||
const [email, setEmail] = React.useState("") | ||
|
||
const sentResetPasswordChallenge = (email) => { | ||
return fetch(`/api/mail/${email}/rest-password-challenge`, { | ||
method: "PUT", | ||
credentials: 'same-origin' | ||
}).then(r => { | ||
if (r.status === 204) { | ||
window.location.href = "/reset-password/successful-reset-password-mail-challenge"; | ||
} | ||
}) | ||
} | ||
|
||
return ( | ||
<ThemeProvider theme={theme}> | ||
<Template maxWidth="sm"> | ||
<Typography variant="h3" component="h3"> | ||
<VpnKey fontSize="large"/> Reset your password | ||
</Typography> | ||
|
||
<Grid style={{marginTop: '10px'}}> | ||
<Divider/> | ||
</Grid> | ||
|
||
<Box> | ||
<FormInputTextField id="email" | ||
label="Email" | ||
|
||
required={true} | ||
handler={(value) => { | ||
setEmail(value.target.value) | ||
}} | ||
value={email || ""} | ||
suffix={<Person fontSize="large"/>}/> | ||
|
||
<Separator/> | ||
|
||
<FormButton type="button" label="Reset passwrd" onClickHandler={() => { | ||
sentResetPasswordChallenge(email) | ||
}}/> | ||
|
||
</Box> | ||
|
||
</Template> | ||
</ThemeProvider> | ||
) | ||
} | ||
if (document.getElementById('app')) { | ||
let features = document.getElementById('features').innerHTML | ||
ReactDOM.render(<ResetPasswordChallengeSender rawFeatures={features}/>, document.getElementById('app')); | ||
} |
File renamed without changes.
File renamed without changes.
34 changes: 34 additions & 0 deletions
34
src/main/frontend/app/reset-password/SuccessfulResetPasswordMailChallengePage.js
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,34 @@ | ||
import ReactDOM from "react-dom"; | ||
import React from "react"; | ||
import {Divider, Grid, ThemeProvider, Typography} from "@mui/material"; | ||
import theme from "../component/styles"; | ||
import Template from "../component/Template"; | ||
import {VpnKey} from "@mui/icons-material"; | ||
|
||
|
||
const SuccessfulResetPasswordMailChallenge = () => { | ||
return ( | ||
<ThemeProvider theme={theme}> | ||
<Template maxWidth="lg"> | ||
<Typography variant="h3" component="h3"> | ||
<VpnKey fontSize="large"/> Reset Password | ||
</Typography> | ||
|
||
<Grid style={{marginTop: '10px'}}> | ||
<Divider/> | ||
</Grid> | ||
|
||
<Typography variant="h3" component="h3"> | ||
We are sent an email on your account inbox please follow the instruction on the mail to reset yout | ||
password | ||
</Typography> | ||
</Template> | ||
</ThemeProvider> | ||
) | ||
} | ||
|
||
|
||
if (document.getElementById('app')) { | ||
let features = document.getElementById('features').innerHTML | ||
ReactDOM.render(<SuccessfulResetPasswordMailChallenge rawFeatures={features}/>, document.getElementById('app')); | ||
} |
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
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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.