2025-10-28 16:42:25 +01:00

16 lines
866 B
TypeScript

import { RootState } from "../types";
export const selectIsLoggedIn = (state: RootState) => state.auth.isLoggedIn;
export const selectStatus = (state: RootState) => state.auth?.status;
export const selectError = (state: RootState) => state.auth?.error;
export const selectAuthMessage = (state: RootState) => state.auth?.authMessage;
export const selectUser = (state: RootState) => state.auth?.user;
export const selectTokenInfo = (state: RootState) => state.auth?.tokenInfo;
export const selectMustChangePassword = (state: RootState) =>
state.auth?.mustChangePassword;
export const selectTimeUntilExpiration = (state: RootState) =>
state.auth?.tokenInfo?.timeUntilExpiration || 0;
export const selectExpiresInHours = (state: RootState) =>
state.auth?.tokenInfo?.expiresInHours || 0;
export const selectAddedUser = (state: RootState) => state.auth?.addedUser;