mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2024-11-21 22:03:58 +00:00
Merge pull request #82 from Mueller-Patrick/BETTERZON-144
BETTERZON-144: Adding service method to get session / user info
This commit is contained in:
commit
c35097a9a2
|
@ -450,6 +450,19 @@ export class ApiService {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all required information about the currently logged in user. If the user is not logged in or the
|
||||
* session is not valid anymore, a 401 will come back from the backend.
|
||||
* @return Observable<any> The observable response of the api
|
||||
*/
|
||||
getUserInfo(): Observable<any> {
|
||||
try {
|
||||
return this.http.post((this.apiUrl + '/users/checkSessionValid'), {});
|
||||
} catch (exception) {
|
||||
process.stderr.write(`ERROR received from ${this.apiUrl}: ${exception}\n`);
|
||||
}
|
||||
}
|
||||
|
||||
/* ______ _ __ __
|
||||
/ ____/___ __ ______ _____(_) /____ _____/ /_ ____ ____ _____
|
||||
/ /_ / __ `/ | / / __ \/ ___/ / __/ _ \ / ___/ __ \/ __ \/ __ \/ ___/
|
||||
|
|
Loading…
Reference in New Issue
Block a user