Files
breadcrumb-the-shire/pages/auth/verify-email(login).phtml
2026-03-07 21:21:47 +01:00

59 lines
2.2 KiB
PHTML

<?php
/**
* @var array<int, string> $errors
* @var string $email
* @var string $code
*/
use MintyPHP\Buffer;
use MintyPHP\Session;
Buffer::set('title', t('Verify email'));
$errorNoticeId = !empty($errors) ? 'auth-verify-email-error-notice' : '';
$authHelpContext = [
'show_back_to_login' => true,
'show_support' => true,
];
?>
<article class="login-card">
<?php require templatePath('partials/auth-logo.phtml'); ?>
<header>
<hgroup>
<h1><?php e(t('Verify email')); ?></h1>
<p><?php e(t('Enter the verification code we sent to your email to complete your registration.')); ?></p>
</hgroup>
</header>
<form method="post">
<label for="email">
<span><?php e(t('Email')); ?></span>
<input required type="email" name="email" id="email" value="<?php e($email ?? ''); ?>" autocomplete="email" <?php if ($errorNoticeId !== ''): ?>aria-invalid="true" aria-describedby="<?php e($errorNoticeId); ?>"<?php endif; ?> />
</label>
<label for="code">
<span><?php e(t('Verification code')); ?></span>
<input required type="text" name="code" id="code" inputmode="numeric" pattern="\d{6}" maxlength="6"
value="<?php e($code ?? ''); ?>" autocomplete="one-time-code" <?php if ($errorNoticeId !== ''): ?>aria-invalid="true" aria-describedby="<?php e($errorNoticeId); ?>"<?php endif; ?> />
</label>
<?php if (!empty($errors)): ?>
<div id="<?php e($errorNoticeId); ?>" class="notice" data-variant="error" role="alert" aria-live="assertive" tabindex="-1">
<ul>
<?php foreach ($errors as $error): ?>
<li><?php e($error); ?></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<button type="submit"><?php e(t('Verify')); ?></button>
<?php Session::getCsrfInput(); ?>
</form>
<hr>
<form method="post" class="text-align-center">
<input type="hidden" name="email" value="<?php e($email ?? ''); ?>">
<input type="hidden" name="action" value="resend">
<?php Session::getCsrfInput(); ?>
<button type="submit" class="secondary outline"><?php e(t('Send code again')); ?></button>
</form>
<?php require templatePath('partials/auth-help-links.phtml'); ?>
</article>