mirror of
https://github.com/Mueller-Patrick/Betterzon.git
synced 2024-11-25 07:33:56 +00:00
BETTERZON-144: Adding service method to get session / user info
This commit is contained in:
parent
6eaf7aca82
commit
f4d1e93a7f
|
@ -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