Added Backend Call Button
This commit is contained in:
@@ -4,6 +4,8 @@
|
||||
<br>
|
||||
<button (click)="paramsFromUrl()">Get Params from URL</button>
|
||||
<br>
|
||||
<button (click)="gotoBackend()">Call Backend</button>
|
||||
<br>
|
||||
Token: <input type="text" [(ngModel)]="id_token">
|
||||
<br>
|
||||
State: <input type="text" [(ngModel)]="state">
|
||||
|
||||
@@ -51,6 +51,17 @@ export class LoginComponent implements OnInit {
|
||||
.subscribe(data => this.loginHTML = this._sanitizer.bypassSecurityTrustHtml(data));
|
||||
}
|
||||
|
||||
gotoBackend() {
|
||||
const headerDict = {
|
||||
'Authorization': 'Bearer ' + this.id_token
|
||||
};
|
||||
this.http.get('https://localhost:8000/api/login',
|
||||
{
|
||||
headers: new HttpHeaders(headerDict)
|
||||
})
|
||||
.subscribe(data => console.log(data));
|
||||
}
|
||||
|
||||
paramsFromUrl() {
|
||||
const url = window.location.href;
|
||||
const params: string = url.split('#')[1];
|
||||
|
||||
Reference in New Issue
Block a user