File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,6 +32,18 @@ function OAuthCallback() {
3232 handleCallback ( ) ;
3333 } , [ authenticationManager ] ) ;
3434
35+ const handleRetry = async ( ) => {
36+ setProcessing ( true ) ;
37+ setError ( null ) ;
38+ try {
39+ const { redirectUrl } = await authenticationManager . initiateAuthentication ( '/' ) ;
40+ window . location . href = redirectUrl . toString ( ) ;
41+ } catch ( e ) {
42+ setError ( e instanceof Error ? e . message : 'Authentication failed' ) ;
43+ setProcessing ( false ) ;
44+ }
45+ } ;
46+
3547 if ( processing ) {
3648 return (
3749 < div className = "container mt-4" >
@@ -50,9 +62,14 @@ function OAuthCallback() {
5062 < div className = "alert alert-danger" >
5163 < h4 > { t ( 'authentication.oauthCallback.authenticationError' ) } </ h4 >
5264 < ErrorDisplay stringError = { error } />
53- < Link className = "btn btn-primary mt-3" to = "/" >
54- { t ( 'authentication.oauthCallback.returnToHome' ) }
55- </ Link >
65+ < div className = "mt-3 d-flex gap-2" >
66+ < button className = "btn btn-primary" onClick = { handleRetry } >
67+ { t ( 'authentication.oauthCallback.retryLogin' ) }
68+ </ button >
69+ < Link className = "btn btn-outline-secondary" to = "/" >
70+ { t ( 'authentication.oauthCallback.returnToHome' ) }
71+ </ Link >
72+ </ div >
5673 </ div >
5774 </ div >
5875 ) ;
Original file line number Diff line number Diff line change @@ -58,6 +58,10 @@ const bootstrapPromise: Promise<Bootstrap> = (async () => {
5858 const client = buildBrowserApolloClient ( authenticityTokensManager , authManager ) ;
5959
6060 window . addEventListener ( GraphQLNotAuthenticatedErrorEvent . type , async ( ) => {
61+ // Don't interrupt an in-progress OAuth exchange on the callback page itself
62+ if ( window . location . pathname === '/oauth/callback' ) {
63+ return ;
64+ }
6165 const { redirectUrl } = await authManager . initiateAuthentication ( window . location . href ) ;
6266 window . location . href = redirectUrl . toString ( ) ;
6367 } ) ;
Original file line number Diff line number Diff line change 633633 "oauthCallback" : {
634634 "authenticationError" : " Authentication Error" ,
635635 "completingLogin" : " Completing login..." ,
636+ "retryLogin" : " Try logging in again" ,
636637 "returnToHome" : " Return to Home"
637638 },
638639 "passwordInput" : {
Original file line number Diff line number Diff line change 7373 "oauthCallback" : {
7474 "authenticationError" : " Authentication Error" ,
7575 "completingLogin" : " Completing login..." ,
76+ "retryLogin" : " Try logging in again" ,
7677 "returnToHome" : " Return to Home"
7778 },
7879 "passwordInput" : {
You can’t perform that action at this time.
0 commit comments