From 8951d00eddb147e5301454f250e503ad19aa47d3 Mon Sep 17 00:00:00 2001 From: benal01 Date: Mon, 17 Mar 2025 20:52:59 -0400 Subject: fixed user authentication bug where user was never admin --- ufund-ui/src/app/components/cupboard/cupboard.component.ts | 3 ++- ufund-ui/src/app/components/need-list/need-list.component.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ufund-ui/src/app/components/cupboard/cupboard.component.ts b/ufund-ui/src/app/components/cupboard/cupboard.component.ts index fc5d7dd..c1bf66c 100644 --- a/ufund-ui/src/app/components/cupboard/cupboard.component.ts +++ b/ufund-ui/src/app/components/cupboard/cupboard.component.ts @@ -81,7 +81,8 @@ needs: any; } isManager() { - return this.usersService.getCurrentUser()?.type == userType.MANAGER; + const type = this.usersService.getCurrentUser()?.type; + return type === ("MANAGER" as unknown as userType); } update(form: any) { diff --git a/ufund-ui/src/app/components/need-list/need-list.component.ts b/ufund-ui/src/app/components/need-list/need-list.component.ts index 6ad9397..4409b63 100644 --- a/ufund-ui/src/app/components/need-list/need-list.component.ts +++ b/ufund-ui/src/app/components/need-list/need-list.component.ts @@ -88,7 +88,8 @@ export class NeedListComponent { } isManager() { - return this.usersService.getCurrentUser()?.type == userType.MANAGER; + const type = this.usersService.getCurrentUser()?.type; + return type === ("MANAGER" as unknown as userType); } back() { -- cgit v1.2.3