Skip to content

Commit

Permalink
remove unnecessary if
Browse files Browse the repository at this point in the history
  • Loading branch information
GailMelanie committed Jan 31, 2025
1 parent c27b6df commit ce939a5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lib/hooks/UseAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@ export function useAuth(): Auth {
getAccount: (): Session | null => {
if (session && session.user) {
// MnestixUser is the default role for a logged-in user
if (session.user) {
session.user.mnestixRole = MnestixRole.MnestixUser;
session.user.allowedRoutes = AllowedRoutes.mnestixUser;
}
session.user.mnestixRole = MnestixRole.MnestixUser;
session.user.allowedRoutes = AllowedRoutes.mnestixUser;

if (session.user.roles && session.user.roles.find((role) => role === MnestixRole.MnestixAdmin)) {
session.user.mnestixRole = MnestixRole.MnestixAdmin;
session.user.allowedRoutes = AllowedRoutes.mnestixAdmin;
Expand Down

0 comments on commit ce939a5

Please sign in to comment.