feat: update login functionality to remove refresh token and adjust password requirements

This commit is contained in:
hamed
2026-06-20 13:22:09 +03:30
parent e2636ce743
commit 943784b64a
2 changed files with 13 additions and 13 deletions
+3 -7
View File
@@ -13,7 +13,6 @@ export interface ContextItem {
interface AuthState {
token: string | null;
refreshToken: string | null;
isAuthenticated: boolean;
userUuid: string | null;
userName: string | null;
@@ -24,7 +23,7 @@ interface AuthState {
context: ContextItem | null;
availableContexts: ContextItem[];
login: (token: string, refreshToken: string) => void;
login: (token: string) => void;
logout: () => void;
fetchMe: () => Promise<void>;
switchContext: (dbUuid: string) => Promise<void>;
@@ -57,7 +56,6 @@ export const useAuthStore = create<AuthState>()(
persist(
(set, get) => ({
token: null,
refreshToken: null,
isAuthenticated: false,
userUuid: null,
userName: null,
@@ -68,15 +66,14 @@ export const useAuthStore = create<AuthState>()(
context: null,
availableContexts: [],
login: (token, refreshToken) => {
set({ token, refreshToken, isAuthenticated: true });
login: (token) => {
set({ token, isAuthenticated: true });
get().fetchMe();
},
logout: () =>
set({
token: null,
refreshToken: null,
isAuthenticated: false,
userUuid: null,
userName: null,
@@ -128,7 +125,6 @@ export const useAuthStore = create<AuthState>()(
name: 'clinicpro-auth',
partialize: (s) => ({
token: s.token,
refreshToken: s.refreshToken,
isAuthenticated: s.isAuthenticated,
userUuid: s.userUuid,
userName: s.userName,