reformat code
This commit is contained in:
parent
374f18a8e7
commit
2518ed7239
@ -16,26 +16,27 @@ export class LoginComponent implements OnInit {
|
|||||||
errorMessage;
|
errorMessage;
|
||||||
|
|
||||||
constructor(private http: HttpClient,
|
constructor(private http: HttpClient,
|
||||||
private activatedRoute: ActivatedRoute) { }
|
private activatedRoute: ActivatedRoute) {
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.activatedRoute.fragment.subscribe(data => {
|
this.activatedRoute.fragment.subscribe(data => {
|
||||||
if (data) {
|
if (data) {
|
||||||
data.split('&').forEach(
|
data.split('&').forEach(
|
||||||
element => {
|
element => {
|
||||||
const split = element.split('=');
|
const split = element.split('=');
|
||||||
if (split[0] === 'error') {
|
if (split[0] === 'error') {
|
||||||
this.errorMessage = split[1];
|
this.errorMessage = split[1];
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
if (split[0] === 'id_token') {
|
||||||
|
this.id_token = split[1];
|
||||||
|
this.parsedToken = JSON.parse(atob(this.id_token.split('.')[1]));
|
||||||
|
} else if (split[0] === 'state') {
|
||||||
|
this.state = split[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (split[0] === 'id_token') {
|
);
|
||||||
this.id_token = split[1];
|
|
||||||
this.parsedToken = JSON.parse(atob(this.id_token.split('.')[1]));
|
|
||||||
} else if (split[0] === 'state') {
|
|
||||||
this.state = split[1];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -67,6 +68,6 @@ export class LoginComponent implements OnInit {
|
|||||||
headers: new HttpHeaders(headerDict),
|
headers: new HttpHeaders(headerDict),
|
||||||
observe: 'response',
|
observe: 'response',
|
||||||
})
|
})
|
||||||
.subscribe(data => alert("Returned with code: "+data['status']));
|
.subscribe(data => alert('Returned with code: ' + data['status']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user