Add isDefaultPassword to JWT

This commit is contained in:
aditya.chandel
2025-03-12 16:00:34 -06:00
parent 795b05944b
commit f62f45d21b
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -9,5 +9,13 @@ export const AuthGuard: CanActivateFn = (route, state) => {
router.navigate(['/login']);
return false;
}
const payload = JSON.parse(atob(token.split('.')[1]));
if (payload.isDefaultPassword) {
router.navigate(['/change-password']);
return false;
}
return true;
};