Skip to content

Commit ec6efd4

Browse files
committed
adjust example
1 parent ce85af5 commit ec6efd4

File tree

5 files changed

+7
-10
lines changed

5 files changed

+7
-10
lines changed

projects/lib/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"author": {
55
"name": "Manfred Steyer"
66
},
7-
"version": "8.0.4",
7+
"version": "9.0.0",
88
"repository": "manfredsteyer/angular-oauth2-oidc",
99
"peerDependencies": {
1010
"@angular/common": ">=6.0.0",

projects/lib/src/oauth-service.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ export class OAuthService extends AuthConfig implements OnDestroy {
223223
* @param options LoginOptions to pass through to `tryLogin(...)`
224224
*/
225225
public loadDiscoveryDocumentAndLogin(options: LoginOptions & { state?: string } = null): Promise<boolean> {
226+
if (!options) {
227+
options = { state: '' };
228+
}
226229
return this.loadDiscoveryDocumentAndTryLogin(options).then(_ => {
227230
if (!this.hasValidIdToken() || !this.hasValidAccessToken()) {
228231
this.initLoginFlow(options.state);

projects/quickstart-demo/src/app/app.component.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import { Component } from '@angular/core';
22
import { OAuthService } from 'angular-oauth2-oidc';
3-
import { authCodeFlowConfig } from 'projects/sample/src/app/auth-code-flow.config';
43
import { filter } from 'rxjs/operators';
5-
import { JwksValidationHandler } from 'angular-oauth2-oidc';
4+
import { authCodeFlowConfig } from './auth.config';
65

76
@Component({
87
selector: 'app-root',
@@ -16,8 +15,6 @@ export class AppComponent {
1615
this.oauthService.configure(authCodeFlowConfig);
1716
this.oauthService.loadDiscoveryDocumentAndLogin();
1817

19-
this.oauthService.tokenValidationHandler = new JwksValidationHandler();
20-
2118
// Automatically load user profile
2219
this.oauthService
2320
.events
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { AuthConfig } from 'angular-oauth2-oidc';
22

33
export const authCodeFlowConfig: AuthConfig = {
4-
issuer: 'https://demo.identityserver.io',
4+
issuer: 'https://idsvr4.azurewebsites.net',
55
redirectUri: window.location.origin + '/index.html',
66
clientId: 'spa',
77
responseType: 'code',
88
scope: 'openid profile email offline_access api',
99
showDebugInformation: true,
10-
1110
};

projects/sample/src/app/auth-code-flow.config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import { AuthConfig } from 'angular-oauth2-oidc';
22

33
export const authCodeFlowConfig: AuthConfig = {
4-
// Url of the Identity Provider
5-
// issuer: 'https://demo.identityserver.io',
6-
issuer: 'http://localhost:5000',
4+
issuer: 'https://idsvr4.azurewebsites.net',
75

86
// URL of the SPA to redirect the user to after login
97
redirectUri: window.location.origin + '/index.html',

0 commit comments

Comments
 (0)