Add verification resend timestamp and cooldown handling for email verification
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m13s
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m13s
This commit is contained in:
@@ -29,8 +29,12 @@ export default function Layout() {
|
||||
await api.post('/auth/resend-verification', { email: user.email });
|
||||
toast.success(t('auth.emailVerificationResendSuccess'));
|
||||
setResendCooldown(60);
|
||||
} catch {
|
||||
toast.error(t('auth.emailVerificationResendFailed'));
|
||||
} catch (err) {
|
||||
const wait = err.response?.data?.waitSeconds;
|
||||
if (wait) {
|
||||
setResendCooldown(wait);
|
||||
}
|
||||
toast.error(err.response?.data?.error || t('auth.emailVerificationResendFailed'));
|
||||
} finally {
|
||||
setResending(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user