mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
fix: restore auth and auto-open last project
This commit is contained in:
@@ -5,6 +5,8 @@ interface AuthState {
|
||||
authChecked: boolean;
|
||||
/** Whether the user is currently authenticated (web mode: valid session cookie) */
|
||||
isAuthenticated: boolean;
|
||||
/** Whether settings have been loaded and hydrated from server */
|
||||
settingsLoaded: boolean;
|
||||
}
|
||||
|
||||
interface AuthActions {
|
||||
@@ -15,15 +17,18 @@ interface AuthActions {
|
||||
const initialState: AuthState = {
|
||||
authChecked: false,
|
||||
isAuthenticated: false,
|
||||
settingsLoaded: false,
|
||||
};
|
||||
|
||||
/**
|
||||
* Web authentication state.
|
||||
*
|
||||
* Intentionally NOT persisted: source of truth is the server session cookie.
|
||||
* Intentionally NOT persisted: source of truth is server session cookie.
|
||||
*/
|
||||
export const useAuthStore = create<AuthState & AuthActions>((set) => ({
|
||||
...initialState,
|
||||
setAuthState: (state) => set(state),
|
||||
setAuthState: (state) => {
|
||||
set({ ...state });
|
||||
},
|
||||
resetAuth: () => set(initialState),
|
||||
}));
|
||||
|
||||
@@ -7,6 +7,7 @@ export interface CliStatus {
|
||||
path: string | null;
|
||||
version: string | null;
|
||||
method: string;
|
||||
hasApiKey?: boolean;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user