readdded the getuserId function
All checks were successful
Build frontend / build (push) Successful in 58s
All checks were successful
Build frontend / build (push) Successful in 58s
This commit is contained in:
@ -93,6 +93,18 @@ const AuthService = Object.freeze({
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get current authenticated user id
|
||||||
|
* @returns {number|string|null}
|
||||||
|
*/
|
||||||
|
getUserId() {
|
||||||
|
const user = this.getUser();
|
||||||
|
if (!user?.id) return null;
|
||||||
|
|
||||||
|
const parsedId = Number(user.id);
|
||||||
|
return Number.isFinite(parsedId) ? parsedId : user.id;
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get roles array from JWT
|
* Get roles array from JWT
|
||||||
* @returns {string[]}
|
* @returns {string[]}
|
||||||
|
|||||||
Reference in New Issue
Block a user