fixing vault. allow users to delete their builds or update

This commit is contained in:
2025-12-21 07:20:22 -05:00
parent 47d5cf239d
commit 008936ff98
5 changed files with 391 additions and 607 deletions
+3 -12
View File
@@ -13,6 +13,7 @@ const API_BASE_URL =
process.env.NEXT_PUBLIC_API_BASE_URL ?? "http://localhost:8080";
type AuthUser = {
uuid: string;
email: string;
displayName?: string | null;
role: string;
@@ -35,14 +36,7 @@ type AuthContextValue = {
* Used for non-password auth flows (ex: magic link).
* Persists session exactly like login/register.
*/
setSession: (
token: string,
user: {
email: string;
displayName: string | null;
role: string;
}
) => void;
setSession: (token: string, user: NonNullable<AuthUser>) => void;
};
const AuthContext = createContext<AuthContextValue | undefined>(undefined);
@@ -95,10 +89,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
}, []);
const setSession = useCallback(
(
nextToken: string,
nextUser: { email: string; displayName: string | null; role: string }
) => {
(nextToken: string, nextUser: NonNullable<AuthUser>) => {
setToken(nextToken);
setUser(nextUser);
persistAuth(nextToken, nextUser);