mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 20:37:21 +00:00
reworked authentication and permission handling
This commit is contained in:
@@ -98,12 +98,16 @@ export class Guard {
|
||||
if (this.user && typeof this.user.role === "string") {
|
||||
const role = this.roles?.find((role) => role.name === this.user?.role);
|
||||
if (role) {
|
||||
debug && console.log("guard: role found", this.user.role);
|
||||
debug && console.log("guard: role found", [this.user.role]);
|
||||
return role;
|
||||
}
|
||||
}
|
||||
|
||||
debug && console.log("guard: role not found", this.user, this.user?.role);
|
||||
debug &&
|
||||
console.log("guard: role not found", {
|
||||
user: this.user,
|
||||
role: this.user?.role
|
||||
});
|
||||
return this.getDefaultRole();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user