Skip to content

Commit

Permalink
[FIX] Login redirection from login/forgot password pages
Browse files Browse the repository at this point in the history
  • Loading branch information
kumanik committed May 30, 2021
1 parent fc1ec07 commit 3b2803d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion eda-frontend/src/pages/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ export default function SignIn (props) {
useEffect(() => {
dispatch(authDefault())
document.title = 'Login - eSim '
if (props.location.search !== '') {
const ardUrl = localStorage.getItem('ard_redurl')
if (ardUrl && ardUrl !== '') {
url = ardUrl
} else if (props.location.search !== '') {
const query = new URLSearchParams(props.location.search)
url = query.get('url')
localStorage.setItem('ard_redurl', url)
Expand Down
2 changes: 1 addition & 1 deletion eda-frontend/src/pages/ResetPassword/Initiation.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function ResetPassword () {
fullWidth
variant="contained"
color="primary"
onClick={() => dispatch(resetPassword(email))}
onClick={() => { email.length > 0 && dispatch(resetPassword(email)) }}
className={classes.submit}
disabled={false}
>
Expand Down
1 change: 1 addition & 0 deletions eda-frontend/src/redux/actions/authActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export const login = (username, password, toUrl) => {
dispatch(loadUser())
} else {
window.open(toUrl, '_self')
localStorage.setItem('ard_redurl', '')
}
} else if (res.status === 400 || res.status === 403 || res.status === 401) {
dispatch({
Expand Down

0 comments on commit 3b2803d

Please sign in to comment.