File tree Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Expand file tree Collapse file tree 1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,22 @@ export default class Authorize extends Component {
160160 }
161161 }
162162
163+ handleLoginError ( error ) {
164+ // https://auth0.com/docs/api-auth/tutorials/silent-authentication#error-response
165+ if (
166+ error . error === 'consent_required' ||
167+ error . error === 'login_required' ||
168+ error . error === 'interaction_required'
169+ ) {
170+ localStorage . removeItem ( CHANNEL ) ;
171+ localStorage . removeItem ( SESSION ) ;
172+ }
173+
174+ if ( this . props . onError ) {
175+ this . props . onError ( error ) ;
176+ }
177+ }
178+
163179 authCheck ( props ) {
164180 if ( this . renewalTimer ) {
165181 clearTimeout ( this . renewalTimer ) ;
@@ -288,7 +304,7 @@ export default class Authorize extends Component {
288304 userInfo : null ,
289305 } ,
290306 ( ) => {
291- this . props . onError && this . props . onError ( error ) ;
307+ this . handleLoginError ( error ) ;
292308 }
293309 ) ;
294310 }
@@ -349,7 +365,7 @@ export default class Authorize extends Component {
349365 userInfo : null ,
350366 } ,
351367 ( ) => {
352- this . props . onError && this . props . onError ( error ) ;
368+ this . handleLoginError ( error ) ;
353369 }
354370 ) ;
355371 }
You can’t perform that action at this time.
0 commit comments