@@ -1264,7 +1264,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
1264
1264
}
1265
1265
1266
1266
return url ;
1267
-
1267
+
1268
1268
}
1269
1269
1270
1270
initImplicitFlowInternal (
@@ -1503,32 +1503,32 @@ export class OAuthService extends AuthConfig implements OnDestroy {
1503
1503
( tokenResponse ) => {
1504
1504
this . debug ( 'refresh tokenResponse' , tokenResponse ) ;
1505
1505
this . storeAccessTokenResponse (
1506
- tokenResponse . access_token ,
1507
- tokenResponse . refresh_token ,
1506
+ tokenResponse . access_token ,
1507
+ tokenResponse . refresh_token ,
1508
1508
tokenResponse . expires_in ,
1509
1509
tokenResponse . scope ) ;
1510
1510
1511
1511
if ( this . oidc && tokenResponse . id_token ) {
1512
- this . processIdToken ( tokenResponse . id_token , tokenResponse . access_token ) .
1512
+ this . processIdToken ( tokenResponse . id_token , tokenResponse . access_token ) .
1513
1513
then ( result => {
1514
1514
this . storeIdToken ( result ) ;
1515
-
1515
+
1516
1516
this . eventsSubject . next ( new OAuthSuccessEvent ( 'token_received' ) ) ;
1517
1517
this . eventsSubject . next ( new OAuthSuccessEvent ( 'token_refreshed' ) ) ;
1518
-
1518
+
1519
1519
resolve ( tokenResponse ) ;
1520
1520
} )
1521
1521
. catch ( reason => {
1522
1522
this . eventsSubject . next ( new OAuthErrorEvent ( 'token_validation_error' , reason ) ) ;
1523
1523
console . error ( 'Error validating tokens' ) ;
1524
1524
console . error ( reason ) ;
1525
-
1525
+
1526
1526
reject ( reason ) ;
1527
1527
} ) ;
1528
1528
} else {
1529
1529
this . eventsSubject . next ( new OAuthSuccessEvent ( 'token_received' ) ) ;
1530
1530
this . eventsSubject . next ( new OAuthSuccessEvent ( 'token_refreshed' ) ) ;
1531
-
1531
+
1532
1532
resolve ( tokenResponse ) ;
1533
1533
}
1534
1534
} ,
@@ -1651,7 +1651,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
1651
1651
. then ( result => {
1652
1652
this . storeIdToken ( result ) ;
1653
1653
this . storeSessionState ( sessionState ) ;
1654
- if ( this . clearHashAfterLogin ) {
1654
+ if ( this . clearHashAfterLogin && ! options . preventClearHashAfterLogin ) {
1655
1655
location . hash = '' ;
1656
1656
}
1657
1657
this . eventsSubject . next ( new OAuthSuccessEvent ( 'token_received' ) ) ;
@@ -1688,7 +1688,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
1688
1688
) : boolean {
1689
1689
const savedNonce = this . _storage . getItem ( 'nonce' ) ;
1690
1690
if ( savedNonce !== nonceInState ) {
1691
-
1691
+
1692
1692
const err = 'Validating access_token failed, wrong state/nonce.' ;
1693
1693
console . error ( err , savedNonce , nonceInState ) ;
1694
1694
return false ;
@@ -1715,7 +1715,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
1715
1715
if ( options . onLoginError ) {
1716
1716
options . onLoginError ( parts ) ;
1717
1717
}
1718
- if ( this . clearHashAfterLogin ) {
1718
+ if ( this . clearHashAfterLogin && ! options . preventClearHashAfterLogin ) {
1719
1719
location . hash = '' ;
1720
1720
}
1721
1721
}
0 commit comments