fixing vault. allow users to delete their builds or update
This commit is contained in:
+3
-12
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user