Skip to content
Snippets Groups Projects
Verified Commit 1a64ee1c authored by Lukas Maximilian Kimpel's avatar Lukas Maximilian Kimpel
Browse files

Implement usage of api to gain jwt token

Create user with freshly generated jwt token
parent 579e56c6
No related merge requests found
......@@ -33,10 +33,12 @@ export class AuthenticationService {
}
guestLogin() {
const token = this.http.get(this.apiBaseUrl + this.apiAuthUrl + this.apiLoginUrl + '/guest');
if (token != null) {
return of(true);
}
this.http.get<string>(this.apiBaseUrl + this.apiAuthUrl + this.apiLoginUrl + '/guest').subscribe(token => {
if (token != null) {
this.user = new User(1337, '', '', UserRole.PARTICIPANT, token);
return of(true);
}
});
return of(false);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment