Skip to content

Commit

Permalink
forward redirectUrl to SSO page
Browse files Browse the repository at this point in the history
  • Loading branch information
simlarsen committed May 4, 2023
1 parent 2e3997a commit 2661cea
Showing 1 changed file with 32 additions and 11 deletions.
43 changes: 32 additions & 11 deletions StatusPage/src/Pages/Accounts/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,38 @@ const LoginPage: FunctionComponent<ComponentProps> = (
) => {
useEffect(() => {
if (props.forceSSO && props.statusPageId) {
Navigation.navigate(
!props.isPreviewPage
? RouteUtil.populateRouteParams(
RouteMap[PageMap.SSO]!,
props.statusPageId
)
: RouteUtil.populateRouteParams(
RouteMap[PageMap.PREVIEW_SSO]!,
props.statusPageId
)
);
if (Navigation.getQueryStringByName('redirectUrl')) {
// forward redirect url to sso page
Navigation.navigate(
new Route(
(!props.isPreviewPage
? RouteUtil.populateRouteParams(
RouteMap[PageMap.SSO]!,
props.statusPageId
)
: RouteUtil.populateRouteParams(
RouteMap[PageMap.PREVIEW_SSO]!,
props.statusPageId
)
).toString() +
`?redirectUrl=${Navigation.getQueryStringByName(
'redirectUrl'
)}`
)
);
} else {
Navigation.navigate(
!props.isPreviewPage
? RouteUtil.populateRouteParams(
RouteMap[PageMap.SSO]!,
props.statusPageId
)
: RouteUtil.populateRouteParams(
RouteMap[PageMap.PREVIEW_SSO]!,
props.statusPageId
)
);
}
}
}, [props.forceSSO, props.statusPageId]);

Expand Down

0 comments on commit 2661cea

Please sign in to comment.