2fa: first draft

This commit is contained in:
slawkens
2025-06-22 08:34:30 +02:00
parent 0f48f12e2e
commit a66cafceab
19 changed files with 549 additions and 1 deletions

View File

@@ -0,0 +1,59 @@
{% set title = 'Enter Email Code' %}
{% set content %}
<table style="width:100%;">
<tbody>
<tr>
<td>
<div class="TableContentContainer">
<table class="TableContent" width="100%" style="border:1px solid #faf0d7;">
<tbody>
<tr>
<td>
<div style="float: right;">
<form
action="{{ getLink('account/2fa') }}?action=email-code&step=resend"
method="post"
style="padding:0;margin:0;"
>
{{ csrf() }}
{% set button_name = 'Resend Email Code' %}
{{ include('buttons.base.html.twig') }}
</form>
</div>
An <b>email code</b> has already been sent to the email address assigned to your account.
Please check your email account's spam/junk filter and make sure that your mailbox is not
full.<br>In case you need a new email code, you can request one by clicking on "Resend Email
Code".
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
<tr>
<td>
<div class="TableContentContainer">
<table class="TableContent" width="100%" style="border:1px solid #faf0d7;">
<tbody>
<tr>
<td><b>Email code authentication is activated for your account.</b><br><br>Please enter the <b>most
recent email code</b> you have received in order to log in.<br>
<div style="margin-top: 15px; margin-bottom: 15px;">
<div class="LabelV150" style="float:left;">Email Code:</div>
<form method="post" action="{{ getLink('account/2fa') }}?action=email-code&step=verify">
{{ csrf() }}
<input name="email-code" maxlength="15" autocomplete="off">
</form>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
{% endset %}
{% include 'tables.headline.html.twig' %}

View File

@@ -0,0 +1,15 @@
{% set title = 'Email Code Authentication Activated' %}
{% set content %}
<table style="width:100%;">
<tbody>
<tr>
<td>You have successfully activated <b>email code authentication</b> for your account. This means an <b>email
code</b> will be sent to the email address assigned to your account whenever you try to log in to the
{{ config.lua.serverName }} client or the {{ config.lua.serverName }} website. In order to log in, you will need to enter the <b>most recent email code</b> you have received.
</td>
</tr>
</tbody>
</table>
{% endset %}
{% include 'tables.headline.html.twig' %}
{{ include('account.back_button.html.twig') }}

View File

@@ -0,0 +1,9 @@
Dear {{ config.lua.serverName}} player,
<br/><br/>
Your account is protected by email code authentication, and you requested a new email code:
<br/><br/>
<p>{{ code }}</p>
<br/>
Note that the code is only valid for 24 hours.
<br/><br/>
Kind Regards,

View File

@@ -0,0 +1,5 @@
Dear {{ config.lua.serverName}} player,<br/>
<br/>
A <strong>wrong two-factor authentication code</strong> was entered for your {{ config.lua.serverName}} account. If you simply mistyped the code, please try again.<br/>
<br/>
However, if this was <strong>not you</strong>, someone else may be trying to access your account. Since they already know your password, we strongly recommend that you <strong>change your password immediately</strong>.