refactor: clarify frontend module ownership
Frontend verify / commits (pull_request) Failing after 1m19s
Frontend verify / security (pull_request) Skipped
Frontend verify / verify (pull_request) Skipped

This commit is contained in:
2026-09-29 07:07:36 +03:00
parent 7c28a423dd
commit f9f0f6921e
91 changed files with 1292 additions and 1050 deletions
+1
View File
@@ -7,6 +7,7 @@ type AuthContextValue = {
logout: () => Promise<void>;
ready: boolean;
register: (email: string, password: string) => Promise<void>;
signedOut: boolean;
user: undefined | User;
};
+4
View File
@@ -31,6 +31,7 @@ function useAuthProviderVm() {
const [user, setUser] = useState<undefined | User>(undefined);
const accessTokenRef = useRef<string | undefined>(undefined);
const [ready, setReady] = useState(false);
const [signedOut, setSignedOut] = useState(false);
const generationRef = useRef(0);
const userRef = useRef<undefined | User>(undefined);
@@ -57,6 +58,7 @@ function useAuthProviderVm() {
const changedIdentity
= userRef.current && userRef.current.id !== authentication.user.id;
setSignedOut(false);
accessTokenRef.current = authentication.accessToken;
if (changedIdentity) {
@@ -136,6 +138,7 @@ function useAuthProviderVm() {
}
async function logout() {
setSignedOut(true);
clearSession();
await serialize(async () => {
await apiClient.POST("/api/v1/auth/logout");
@@ -159,6 +162,7 @@ function useAuthProviderVm() {
ready,
register: (email: string, password: string) =>
authenticate("/api/v1/auth/register", email, password),
signedOut,
user,
};