fixed some missed data, added role based function(user)
This commit is contained in:
@@ -36,6 +36,13 @@ export interface AuthUser {
|
||||
createdAt?: string;
|
||||
}
|
||||
|
||||
/** Returns the role-appropriate landing page for the current user. */
|
||||
export function getHomePath(): string {
|
||||
const user = useAuthStore.getState().user;
|
||||
const isAdmin = user?.role?.code === "admin";
|
||||
return isAdmin ? "/dashboard" : "/loan-orders";
|
||||
}
|
||||
|
||||
interface AuthState {
|
||||
token: string | null;
|
||||
refreshTokenValue: string | null;
|
||||
|
||||
Reference in New Issue
Block a user