Add verification resend timestamp and cooldown handling for email verification
All checks were successful
Build & Push Docker Image / build (push) Successful in 6m13s

This commit is contained in:
2026-02-27 17:23:22 +01:00
parent 4d6a09c3fd
commit 9814150ba8
4 changed files with 34 additions and 7 deletions

View File

@@ -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);
}