From 2b11d338e059275ccb074c0f08a0019cac6b78ea Mon Sep 17 00:00:00 2001 From: jack <jack.su@pollex.com.tw> Date: 星期二, 12 九月 2023 15:49:10 +0800 Subject: [PATCH] [UPDATE] 解決弱點Unlogged security exception --- PAMapp/shared/services/auth.service.ts | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/PAMapp/shared/services/auth.service.ts b/PAMapp/shared/services/auth.service.ts index 6c10d47..e467576 100644 --- a/PAMapp/shared/services/auth.service.ts +++ b/PAMapp/shared/services/auth.service.ts @@ -1,15 +1,13 @@ -import { Role } from "../models/enum/role"; +import { Role } from "../models/enum/Role"; class AuthService { - private idToken = localStorage.getItem('id_token'); - private currentRole = localStorage.getItem('current_role'); isAdminLogin(): boolean { - return this.currentRole === Role.ADMIN; + return localStorage.getItem('current_role') === Role.ADMIN; } isUserLogin(): boolean { - return this.currentRole === Role.USER; + return localStorage.getItem('current_role') === Role.USER; } } -- Gitblit v1.8.0