Skip to content

Commit 3c50797

Browse files
committed
fix #91
1 parent 2f62ed0 commit 3c50797

File tree

5 files changed

+18
-32
lines changed

5 files changed

+18
-32
lines changed

sample/src/app/app.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ export class AppComponent {
1717

1818
// this.configureWithNewConfigApi();
1919
this.configureAuth();
20-
this.configurePasswordFlow();
20+
// this.configurePasswordFlow();
2121

2222
}
2323

24+
2425
// This api will come in the next version
2526
/*
2627
private configureWithNewConfigApi() {

sample/src/app/app.module.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import {NgModule} from '@angular/core';
22
import {FormsModule, ReactiveFormsModule} from '@angular/forms';
33
import {HttpModule} from '@angular/http';
44
import {BrowserModule} from '@angular/platform-browser';
5-
import {AUTH_CONFIG, JwksValidationHandler, OAuthModule, OAuthStorage, ValidationHandler} from 'angular-oauth2-oidc';
5+
import {JwksValidationHandler, OAuthModule, ValidationHandler} from 'angular-oauth2-oidc';
66

77
import {AppComponent} from './app.component';
88
import {AppRouterModule} from './app.routes';
99
import {BASE_URL} from './app.tokens';
10-
import {DemoStorage} from './demo-storage';
1110
import {FlightHistoryComponent} from './flight-history/flight-history.component';
1211
import {HomeComponent} from './home/home.component';
1312
import {SharedModule} from './shared/shared.module';

sample/src/app/demo-storage.ts

Lines changed: 0 additions & 20 deletions
This file was deleted.

sample/src/app/flight-booking/flight-search/flight-search.component.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,26 @@
1-
import { Component } from '@angular/core';
2-
import {Flight} from "../../entities/flight";
3-
import {Http, URLSearchParams, Headers } from '@angular/http';
4-
import {FlightService} from "../services/flight.service";
1+
import {Component} from '@angular/core';
2+
import {Headers, Http, URLSearchParams} from '@angular/http';
3+
4+
import {OAuthService} from 'angular-oauth2-oidc';
5+
import {Flight} from '../../entities/flight';
6+
import {FlightService} from '../services/flight.service';
57

68
@Component({
7-
selector: 'flight-search',
8-
templateUrl: './flight-search.component.html',
9-
styleUrls: ['./flight-search.component.css']
9+
selector: 'flight-search',
10+
templateUrl: './flight-search.component.html',
11+
styleUrls: ['./flight-search.component.css']
1012
})
1113
export class FlightSearchComponent {
1214

1315
public from: string = "Graz";
1416
public to: string = "";
1517
public selectedFlight: Flight;
1618

17-
constructor(private flightService: FlightService) {
19+
constructor(
20+
private flightService: FlightService,
21+
private oauthService: OAuthService
22+
) {
23+
console.debug('access-token', this.oauthService.getAccessToken());
1824
}
1925

2026
// cmp.flights

sample/src/app/home/home.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export class HomeComponent implements OnInit {
131131
* Tweak config for implicit flow.
132132
* This is needed b/c this sample uses both flows
133133
*/
134-
this.oauthService.clientId = "spa-demo";
134+
//this.oauthService.clientId = "spa-demo";
135135
this.oauthService.oidc = true;
136136

137137
this

0 commit comments

Comments
 (0)