aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/app/hooks/useAuth.ts
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-03-06 02:18:40 +0900
committernsfisis <nsfisis@gmail.com>2026-03-06 02:18:40 +0900
commit46f9ba5d8c295454381655e6ec02ad3cf8bd79db (patch)
treec54719cb129ee05f96c4898219588062f71daa36 /frontend/app/hooks/useAuth.ts
parent27f509ccf4fbfeaa1bc2580ae2251461dc44ebfa (diff)
downloadphperkaigi-2026-albatross-46f9ba5d8c295454381655e6ec02ad3cf8bd79db.tar.gz
phperkaigi-2026-albatross-46f9ba5d8c295454381655e6ec02ad3cf8bd79db.tar.zst
phperkaigi-2026-albatross-46f9ba5d8c295454381655e6ec02ad3cf8bd79db.zip
style: switch from tab to space indentation in frontend and worker/php
Update biome.json indentStyle from "tab" to "space" and reformat all files in both workspaces. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'frontend/app/hooks/useAuth.ts')
-rw-r--r--frontend/app/hooks/useAuth.ts44
1 files changed, 22 insertions, 22 deletions
diff --git a/frontend/app/hooks/useAuth.ts b/frontend/app/hooks/useAuth.ts
index 7913a0e..35eafaa 100644
--- a/frontend/app/hooks/useAuth.ts
+++ b/frontend/app/hooks/useAuth.ts
@@ -3,31 +3,31 @@ import { apiGetMe, apiLogin, apiLogout } from "../api/client";
import type { User } from "../auth";
export function useAuth(): {
- user: User | null;
- isLoggedIn: boolean;
- isLoading: boolean;
- login: (username: string, password: string) => Promise<void>;
- logout: () => Promise<void>;
+ user: User | null;
+ isLoggedIn: boolean;
+ isLoading: boolean;
+ login: (username: string, password: string) => Promise<void>;
+ logout: () => Promise<void>;
} {
- const [user, setUser] = useState<User | null>(null);
- const [isLoading, setIsLoading] = useState(true);
+ const [user, setUser] = useState<User | null>(null);
+ const [isLoading, setIsLoading] = useState(true);
- useEffect(() => {
- apiGetMe()
- .then((data) => setUser(data?.user ?? null))
- .catch(() => setUser(null))
- .finally(() => setIsLoading(false));
- }, []);
+ useEffect(() => {
+ apiGetMe()
+ .then((data) => setUser(data?.user ?? null))
+ .catch(() => setUser(null))
+ .finally(() => setIsLoading(false));
+ }, []);
- const login = useCallback(async (username: string, password: string) => {
- const { user } = await apiLogin(username, password);
- setUser(user);
- }, []);
+ const login = useCallback(async (username: string, password: string) => {
+ const { user } = await apiLogin(username, password);
+ setUser(user);
+ }, []);
- const logout = useCallback(async () => {
- await apiLogout();
- setUser(null);
- }, []);
+ const logout = useCallback(async () => {
+ await apiLogout();
+ setUser(null);
+ }, []);
- return { user, isLoggedIn: user !== null, isLoading, login, logout };
+ return { user, isLoggedIn: user !== null, isLoading, login, logout };
}