refactor: improve type safety, update navigation, and optimize base64 encoding in auth and editor components

This commit is contained in:
Your Name
2026-04-11 19:33:50 +05:30
parent 4f0355d8eb
commit 9953b27385
7 changed files with 29 additions and 22 deletions
+2 -8
View File
@@ -1,13 +1,7 @@
import { useCallback } from "react";
import { api, publicApi } from "../api/apiClient";
import { endpoints } from "../config/endpoints";
import { useAuthStore } from "../store/useAuthStore";
interface UserProfile {
public_id: string;
email: string;
full_name: string;
}
import { type UserProfile, useAuthStore } from "../store/useAuthStore";
export const useAuth = () => {
const { accessToken, user, isInitializing, setAuth, clearAuth } =
@@ -15,7 +9,7 @@ export const useAuth = () => {
const isAuthenticated = !!accessToken;
const login = async (access: string, profile: UserProfile) => {
const login = (access: string, profile: UserProfile) => {
setAuth(access, profile);
};