This commit is contained in:
gpt-engineer-app[bot]
2026-01-27 23:05:30 +00:00
parent cba635b8f9
commit 2ea67737c3
4 changed files with 285 additions and 36 deletions
+16
View File
@@ -51,6 +51,20 @@ export function useAuth() {
return { error };
};
const resetPassword = async (email: string) => {
const { error } = await supabase.auth.resetPasswordForEmail(email, {
redirectTo: `${window.location.origin}/reset-password`,
});
return { error };
};
const updatePassword = async (newPassword: string) => {
const { error } = await supabase.auth.updateUser({
password: newPassword,
});
return { error };
};
return {
user,
session,
@@ -58,5 +72,7 @@ export function useAuth() {
signUp,
signIn,
signOut,
resetPassword,
updatePassword,
};
}