Skip to content

Commit ed56ab1

Browse files
committed
feat: add views for magic login code
1 parent 18e746d commit ed56ab1

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2+
3+
<head>
4+
<meta name="x-apple-disable-message-reformatting">
5+
<meta name="viewport" content="width=device-width, initial-scale=1">
6+
<meta name="format-detection" content="telephone=no, date=no, address=no, email=no">
7+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
8+
<title><?= lang('Auth.magicLinkSubject') ?></title>
9+
</head>
10+
11+
<body>
12+
<p><?= lang('Auth.email2FAMailBody') ?></p>
13+
<div style="text-align: center">
14+
<h1><?= $token ?></h1>
15+
</div>
16+
<table role="presentation" border="0" cellpadding="0" cellspacing="0" style="width: 100%;" width="100%">
17+
<tbody>
18+
<tr>
19+
<td style="line-height: 20px; font-size: 20px; width: 100%; height: 20px; margin: 0;" align="left" width="100%" height="20">
20+
&#160;
21+
</td>
22+
</tr>
23+
</tbody>
24+
</table>
25+
<b><?= lang('Auth.emailInfo') ?></b>
26+
<p><?= lang('Auth.username') ?>: <?= esc($user->username) ?></p>
27+
<p><?= lang('Auth.emailIpAddress') ?> <?= esc($ipAddress) ?></p>
28+
<p><?= lang('Auth.emailDevice') ?> <?= esc($userAgent) ?></p>
29+
<p><?= lang('Auth.emailDate') ?> <?= esc($date) ?></p>
30+
</body>
31+
32+
</html>

src/Views/magic_link_code.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?= $this->extend(config('Auth')->views['layout']) ?>
2+
3+
<?= $this->section('title') ?><?= lang('Auth.verifyMagicCode') ?> <?= $this->endSection() ?>
4+
5+
<?= $this->section('main') ?>
6+
<div class="container d-flex justify-content-center p-5">
7+
<div class="card col-12 col-md-5 shadow-sm">
8+
<div class="card-body">
9+
<h5 class="card-title mb-5"><?= lang('Auth.verifyMagicCode') ?></h5>
10+
<form action="<?= route_to('verify-magic-link') ?>" method="post">
11+
<?= csrf_field() ?>
12+
<div class="mb-3">
13+
<label for="magicCode" class="form-label"><?= lang('Auth.magicCodeText', [strtok(config('Auth')->magicLoginMode, '-')]) ?></label>
14+
<input type="text" class="form-control" name="magicCode" id="magicCode" maxlength="<?= strtok(config('Auth')->magicLoginMode, '-'); ?>" pattern="[a-zA-Z0-9]{<?= strtok(config('Auth')->magicLoginMode, '-'); ?>}" required>
15+
</div>
16+
<button type="submit" class="btn btn-primary"><?= lang('Auth.login') ?></button>
17+
</form>
18+
</div>
19+
</div>
20+
</div>
21+
<?= $this->endSection() ?>

0 commit comments

Comments
 (0)