File tree 3 files changed +4
-9
lines changed
3 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -1253,7 +1253,7 @@ export class OAuthService extends AuthConfig implements OnDestroy {
1253
1253
const nonce = await this . createAndSaveNonce ( ) ;
1254
1254
1255
1255
if ( state ) {
1256
- state = nonce + this . config . nonceStateSeparator + state ;
1256
+ state = nonce + this . config . nonceStateSeparator + encodeURIComponent ( state ) ;
1257
1257
} else {
1258
1258
state = nonce ;
1259
1259
}
@@ -1461,8 +1461,6 @@ export class OAuthService extends AuthConfig implements OnDestroy {
1461
1461
}
1462
1462
}
1463
1463
1464
-
1465
-
1466
1464
private parseQueryString ( queryString : string ) : object {
1467
1465
if ( ! queryString || queryString . length === 0 ) {
1468
1466
return { } ;
@@ -1473,8 +1471,6 @@ export class OAuthService extends AuthConfig implements OnDestroy {
1473
1471
}
1474
1472
1475
1473
return this . urlHelper . parseQueryString ( queryString ) ;
1476
-
1477
-
1478
1474
}
1479
1475
1480
1476
public tryLoginCodeFlow ( options : LoginOptions = null ) : Promise < void > {
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ export class AppComponent {
27
27
this . oauthService . events
28
28
. pipe ( filter ( e => e . type === 'token_received' ) )
29
29
. subscribe ( _ => {
30
+ console . debug ( 'state' , this . oauthService . state ) ;
30
31
this . oauthService . loadUserProfile ( ) ;
31
32
} ) ;
32
33
@@ -57,7 +58,6 @@ export class AppComponent {
57
58
// Optional
58
59
this . oauthService . setupAutomaticSilentRefresh ( ) ;
59
60
60
-
61
61
// Display all events
62
62
this . oauthService . events . subscribe ( e => {
63
63
// tslint:disable-next-line:no-console
@@ -70,7 +70,6 @@ export class AppComponent {
70
70
// tslint:disable-next-line:no-console
71
71
console . debug ( 'Your session has been terminated!' ) ;
72
72
} ) ;
73
-
74
73
}
75
74
76
75
//
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export class HomeComponent implements OnInit {
33
33
await this . oauthService . loadDiscoveryDocument ( ) ;
34
34
sessionStorage . setItem ( 'flow' , 'implicit' ) ;
35
35
36
- this . oauthService . initLoginFlow ( '/some-state;p1=1;p2=2' ) ;
36
+ this . oauthService . initLoginFlow ( '/some-state;p1=1;p2=2?p3=3&p4=4 ' ) ;
37
37
// the parameter here is optional. It's passed around and can be used after logging in
38
38
}
39
39
@@ -56,7 +56,7 @@ export class HomeComponent implements OnInit {
56
56
await this . oauthService . loadDiscoveryDocument ( ) ;
57
57
sessionStorage . setItem ( 'flow' , 'code' ) ;
58
58
59
- this . oauthService . initLoginFlow ( '/some-state;p1=1;p2=2' ) ;
59
+ this . oauthService . initLoginFlow ( '/some-state;p1=1;p2=2?p3=3&p4=4 ' ) ;
60
60
// the parameter here is optional. It's passed around and can be used after logging in
61
61
}
62
62
You can’t perform that action at this time.
0 commit comments