2022-11-23 23:36:30 +01:00
|
|
|
{% extends "account/account_base.twig" %}
|
2021-12-08 16:53:43 +01:00
|
|
|
|
2022-12-02 13:52:24 +01:00
|
|
|
{% set view_title = 'account.confirm_email_title' %}
|
2021-12-08 16:53:43 +01:00
|
|
|
{% set view_icon = 'user-check' %}
|
2022-12-02 13:52:24 +01:00
|
|
|
{% set view_description = 'account.confirm_email_description' %}
|
2021-12-08 16:53:43 +01:00
|
|
|
|
|
|
|
{% block view_content %}
|
|
|
|
<noscript>
|
2022-12-02 13:52:24 +01:00
|
|
|
<div class="alert alert-danger">{{ L('general.noscript') }}</div>
|
2021-12-08 16:53:43 +01:00
|
|
|
</noscript>
|
|
|
|
<div class="alert alert-info" id="confirm-status">
|
2022-12-02 13:52:24 +01:00
|
|
|
{{ L('account.confirming_email') }}… <i class="fas fa-spinner fa-spin"></i>
|
2021-12-08 16:53:43 +01:00
|
|
|
</div>
|
2022-12-02 13:52:24 +01:00
|
|
|
<a href='/login'>
|
|
|
|
<button class='btn btn-primary' style='position: absolute; bottom: 30px' type='button'>
|
|
|
|
{{ L("account.proceed_to_login") }}
|
|
|
|
</button>
|
|
|
|
</a>
|
2021-12-08 16:53:43 +01:00
|
|
|
<script nonce="{{ site.csp.nonce }}">
|
|
|
|
$(document).ready(function() {
|
|
|
|
let token = jsCore.getParameter("token");
|
|
|
|
let confirmStatus = $("#confirm-status");
|
|
|
|
if (token) {
|
|
|
|
jsCore.apiCall("/user/confirmEmail", { token: token }, (res) => {
|
|
|
|
confirmStatus.removeClass("alert-info");
|
|
|
|
if (!res.success) {
|
|
|
|
confirmStatus.addClass("alert-danger");
|
2022-12-02 13:52:24 +01:00
|
|
|
confirmStatus.text("{{ L('account.confirm_error') }}: " + res.msg);
|
2021-12-08 16:53:43 +01:00
|
|
|
} else {
|
|
|
|
confirmStatus.addClass("alert-success");
|
2022-12-02 13:52:24 +01:00
|
|
|
confirmStatus.text("{{ L('account.confirm_success') }}");
|
2021-12-08 16:53:43 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
confirmStatus.removeClass("alert-info");
|
|
|
|
confirmStatus.addClass("alert-danger");
|
2022-12-02 13:52:24 +01:00
|
|
|
confirmStatus.text("{{ L('account.invalid_link') }}");
|
2021-12-08 16:53:43 +01:00
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{% endblock %}
|