File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
Expand file tree Collapse file tree 1 file changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -18,23 +18,19 @@ export const callback = async (routerClient: RouterClient) => {
1818 if ( errorParam ?. toLowerCase ( ) === "login_link_expired" ) {
1919 const reauthState = routerClient . getSearchParam ( "reauth_state" ) ;
2020 if ( reauthState ) {
21- const decodedAuthState = atob ( reauthState ) ;
2221 try {
23- const reauthState = JSON . parse ( decodedAuthState ) ;
24- if ( reauthState ) {
25- const urlParams = new URLSearchParams ( reauthState ) ;
22+ const decodedAuthState = atob ( reauthState ) ;
23+ const parsedReauthState = JSON . parse ( decodedAuthState ) ;
24+ if ( parsedReauthState ) {
25+ const urlParams = new URLSearchParams ( parsedReauthState ) ;
2626 const loginRoute = new URL (
2727 `${ config . redirectURL } ${ config . apiPath } /${ routes . login } ` ,
2828 ) ;
2929 loginRoute . search = urlParams . toString ( ) ;
3030 return routerClient . redirect ( loginRoute . toString ( ) ) ;
3131 }
32- } catch ( ex ) {
33- throw new Error (
34- ex instanceof Error
35- ? ex . message
36- : "Unknown Error parsing reauth state" ,
37- ) ;
32+ } catch {
33+ return redirectToLogin ( routerClient ) ;
3834 }
3935 }
4036 return redirectToLogin ( routerClient ) ;
You can’t perform that action at this time.
0 commit comments