Add timeout to updatePassword to avoid hanging
cgen-bc6076bfab7c4cd3a485982894412135
This commit is contained in:
parent
b011b673a4
commit
4778afa83f
1 changed files with 5 additions and 3 deletions
|
|
@ -860,9 +860,11 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({
|
|||
try {
|
||||
await supabase.auth.getSession();
|
||||
} catch {}
|
||||
const { data, error } = await supabase.auth.updateUser({
|
||||
password: newPassword,
|
||||
});
|
||||
const { data, error } = await withTimeout(
|
||||
supabase.auth.updateUser({ password: newPassword }),
|
||||
8000,
|
||||
"Password update timed out"
|
||||
);
|
||||
if (error) throw error;
|
||||
if (data?.user) {
|
||||
aethexToast.success({
|
||||
|
|
|
|||
Loading…
Reference in a new issue