-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DAH-2876 feat: allow redirect after sign in #2435
base: main
Are you sure you want to change the base?
Changes from all commits
86109ee
daf610d
24ea89d
ea3b68b
1d395ad
68f7b5d
b45150e
87854a6
da08a11
49ac614
1cbfc59
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ import { | |
getSignInPath, | ||
} from "../../util/routeUtil" | ||
import { renderInlineMarkup } from "../../util/languageUtil" | ||
import { setSiteAlertMessage } from "../../components/SiteAlert" | ||
|
||
interface MyAccountProps { | ||
assetPaths: unknown | ||
|
@@ -62,7 +63,8 @@ const MyAccount = (_props: MyAccountProps) => { | |
const { profile, loading, initialStateLoaded } = React.useContext(UserContext) | ||
|
||
if (!profile && !loading && initialStateLoaded) { | ||
// TODO: Redirect to React sign in page and show a message that user needs to sign in | ||
window.sessionStorage.setItem("redirect", "account") | ||
setSiteAlertMessage(t("signIn.loginRequired"), "secondary") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thought: We're well along this path now, but in the future we should look into using constants instead of strings for things like "redirect", "account", and "secondary". |
||
window.location.href = getSignInPath() | ||
return null | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ import "./styles/my-applications.scss" | |
import { DoubleSubmittedModal } from "./components/DoubleSubmittedModal" | ||
import { AlreadySubmittedModal } from "./components/AlreadySubmittedModal" | ||
import { extractModalParamsFromUrl } from "./components/util" | ||
import { setSiteAlertMessage } from "../../components/SiteAlert" | ||
|
||
export const noApplications = () => { | ||
return ( | ||
|
@@ -198,6 +199,8 @@ const MyApplications = () => { | |
}, [authLoading, initialStateLoaded, profile]) | ||
|
||
if (!profile && !authLoading && initialStateLoaded) { | ||
window.sessionStorage.setItem("redirect", "applications") | ||
setSiteAlertMessage(t("signIn.loginRequired"), "secondary") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (I think) This has been fixed in main and the fix just hasn't been pulled into this branch yet |
||
window.location.href = getSignInPath() | ||
return null | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thought: We're using
sessionStorage
across various files, and it's not immediately obvious what arguments forsetItem
mean. We should look into consolidating all routing-relatedsessionStorage
usage into a single file, probably inrouteUtil.ts
.