This commit is contained in:
2022-12-30 16:23:27 +00:00
parent 02776e8478
commit 20da343c54
1304 changed files with 870224 additions and 0 deletions

View File

@ -0,0 +1,13 @@
{% extends "error.html" %}
{% block error_name %}{{ error }}{% endblock %}
{% block error_description %}
{% if show_resend_activation %}
<div class="text-center text-muted small mt-4">
Ask for another activation email?
<a href="{{ url_for('auth.resend_activation') }}" style="color: #4d21ff">Resend</a>
</div>
{% endif %}
{% endblock %}

View File

@ -0,0 +1,21 @@
{% extends "single.html" %}
{% block title %}Change Email{% endblock %}
{% block single_content %}
<div class="card">
<div class="card-body p-6">
<div class="h3 text-center">Email Update</div>
<div class="text-danger text-center h4">
Incorrect or expired link.
<br />
<br />
</div>
<div class="text-center">
Please go to
<a href="{{ url_for('dashboard.setting') }}">settings</a>
page to re-send the confirmation email.
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,75 @@
{% extends "single.html" %}
{% block title %}Verify Your Security Key{% endblock %}
{% block head %}
<script src="{{ url_for('static', filename='assets/js/vendors/base64.js') }}"></script>
<script src="{{ url_for('static', filename='assets/js/vendors/webauthn.js') }}"></script>
{% endblock %}
{% block single_content %}
<div class="card">
<div class="card-body">
<div class="mb-2">
Your account is protected with your security key (WebAuthn).
<br />
<br />
Follow your browser's steps to continue the sign-in process.
</div>
<form id="formRegisterKey" method="post">
{{ fido_token_form.csrf_token }}
{{ fido_token_form.sk_assertion(class="form-control", placeholder="") }}
<div class="text-center">
<button id="btnVerifyKey" class="btn btn-success mt-2" onclick="verifyKey();">Use your security key</button>
</div>
<div class="form-check">
{{ fido_token_form.remember(class="form-check-input", id="remember") }}
<label class="form-check-label" for="remember">{{ fido_token_form.remember.description }}</label>
</div>
</form>
{% if enable_otp %}
<hr />
<div class="text-muted mt-5" style="margin-top: 1em;">
Don't have your key with you?
<br />
<a href="{{ url_for('auth.mfa') }}">Verify by One-Time Password</a>
</div>
{% endif %}
<hr />
<div class="mt-5">
If you have troubles with your authentication app, you can use the recovery code to login.
<br />
<a href="{{ url_for('auth.recovery_route', next=next_url) }}">Use Recovery Codes</a>
</div>
<script>
async function verifyKey() {
$("#btnVerifyKey").prop('disabled', true);
$("#btnVerifyKey").text('Waiting for Security Key...');
const credentialRequestOptions = transformCredentialRequestOptions(
JSON.parse('{{webauthn_assertion_options|tojson|safe}}')
)
let assertion;
try {
assertion = await navigator.credentials.get({
publicKey: credentialRequestOptions
});
} catch (err) {
toastr.error("An error occurred when we trying to verify your key.");
$("#btnVerifyKey").prop('disabled', false);
$("#btnVerifyKey").text('Use your security key');
return console.error("Error when trying to get credential:", err);
}
const skAssertion = transformAssertionForServer(assertion);
$('#sk_assertion').val(JSON.stringify(skAssertion));
$('#formRegisterKey').submit();
}
</script>
{% if auto_activate %}<script>$('document').ready(verifyKey());</script>{% endif %}
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,26 @@
{% extends "single.html" %}
{% block title %}Forgot Password{% endblock %}
{% block single_content %}
{% if error %}<div class="text-danger text-center mb-4">{{ error }}</div>{% endif %}
<form class="card" method="post">
{{ form.csrf_token }}
<div class="card-body p-6">
<h1 class="card-title">Forgot password</h1>
<div class="form-group">
<label class="form-label">Email address</label>
{{ form.email(class="form-control", type="email") }}
{{ render_field_errors(form.email) }}
</div>
<div class="form-footer">
<button type="submit" class="btn btn-primary btn-block">Reset Password</button>
</div>
</div>
</form>
<div class="text-center text-muted">
Forget it,
<a href="{{ url_for('auth.login') }}">send me back</a>
to the sign in screen.
</div>
{% endblock %}

View File

@ -0,0 +1,52 @@
{% extends "single.html" %}
{% block title %}Login{% endblock %}
{% block single_content %}
{% if show_resend_activation %}
<div class="text-center text-muted small mb-4">
You haven't received the activation email?
<a href="{{ url_for('auth.resend_activation') }}">Resend</a>
</div>
{% endif %}
<div class="card" style="border-radius: 2%">
<div class="card-body p-6">
<h1 class="card-title">Welcome back!</h1>
<form method="post">
{{ form.csrf_token }}
<div class="form-group">
<label class="form-label">Email address</label>
{{ form.email(class="form-control", type="email", autofocus="true") }}
{{ render_field_errors(form.email) }}
</div>
<div class="form-group">
<label class="form-label">Password</label>
{{ form.password(class="form-control", type="password") }}
{{ render_field_errors(form.password) }}
<div class="text-muted">
<a href="{{ url_for('auth.forgot_password') }}" class="small">I forgot my password</a>
</div>
</div>
<div class="form-footer">
<button type="submit" class="btn btn-primary btn-block">Log in</button>
</div>
</form>
{% if connect_with_proton %}
<div class="text-center my-2 text-gray">
<span>or</span>
</div>
<a class="btn btn-primary btn-block mt-2 proton-button"
href="{{ url_for("auth.proton_login", next=next_url) }}">
<img class="mr-2" src="/static/images/proton.svg" />
Log in with Proton
</a>
{% endif %}
</div>
</div>
<div class="text-center text-muted mt-2">
Don't have an account yet?
<a href="{{ url_for('auth.register') }}">Sign up</a>
</div>
{% endblock %}

View File

@ -0,0 +1,47 @@
{% extends "single.html" %}
{% block title %}MFA{% endblock %}
{% block single_content %}
<div class="card">
<div class="card-body p-6">
<div class="mb-2">
Your account is protected with Two Factor Authentication.
<br />
<br />
You will need to enter your 2FA authentication code.
</div>
<form method="post">
{{ otp_token_form.csrf_token }}
<input type="hidden" name="form-name" value="create" />
<div class="font-weight-bold mt-5">Token</div>
<div class="small-text mb-3">Please enter the 2FA code from your 2FA authenticator</div>
{{ otp_token_form.token(class="form-control", autofocus="true") }}
{{ render_field_errors(otp_token_form.token) }}
<div class="form-check">
{{ otp_token_form.remember(class="form-check-input", id="remember") }}
<label class="form-check-label" for="remember">{{ otp_token_form.remember.description }}</label>
</div>
<button class="btn btn-success mt-2">Submit</button>
</form>
{% if enable_fido %}
<hr />
<div class="text-muted mt-5" style="margin-top: 1em;">
Having trouble with your authenticator?
<br />
<a href="{{ url_for('auth.fido') }}">
Verify by your security
key
</a>
</div>
{% endif %}
<hr />
<div class="mt-5">
If you cannot access your authenticator application you can instead use a recovery code.
<br />
<a href="{{ url_for('auth.recovery_route', next=next_url) }}">Use Recovery Code</a>
</div>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,18 @@
{% extends "single.html" %}
{% block title %}Recovery Code{% endblock %}
{% block single_content %}
<div class="card">
<div class="card-body p-6">
<form method="post">
{{ recovery_form.csrf_token }}
<div class="font-weight-bold mt-5">Code</div>
<div class="small-text">Please enter one of the recovery codes here</div>
{{ recovery_form.code(class="form-control", autofocus="true") }}
{{ render_field_errors(recovery_form.code) }}
<button class="btn btn-success mt-2">Submit</button>
</form>
</div>
</div>
{% endblock %}

View File

@ -0,0 +1,61 @@
{% extends "single.html" %}
{% block title %}Register{% endblock %}
{% block single_content %}
<form class="card" style="border-radius: 2%" method="post">
{{ form.csrf_token }}
<div class="card-body p-6">
<h1 class="card-title">Create new account</h1>
<div class="form-group">
<label class="form-label">Email address</label>
{{ form.email(class="form-control", type="email") }}
<div class="small-text alert alert-info" style="margin-top: 1px">
Emails sent to your alias will be forwarded to this email address.
It can't be a disposable or forwarding email address.
</div>
{{ render_field_errors(form.email) }}
</div>
<div class="form-group">
<label class="form-label">Password</label>
{{ form.password(class="form-control", type="password") }}
{{ render_field_errors(form.password) }}
</div>
<!-- TODO: add terms
<div class="form-group">
<label class="custom-control custom-checkbox">
<input type="checkbox" class="custom-control-input"/>
<span class="custom-control-label">Agree the <a href="terms.html">terms and policy</a></span>
</label>
</div>
-->
{% if HCAPTCHA_SITEKEY %}
<div class="h-captcha" data-sitekey="{{ HCAPTCHA_SITEKEY }}"></div>
<script src="https://hcaptcha.com/1/api.js" async defer></script>
{% endif %}
<small class="text-center mt-3">
By clicking Create Account, you agree to abide by
<a href="https://simplelogin.io/terms">SimpleLogin's Terms and Conditions.</a>
</small>
<div class="mt-2">
<button type="submit" class="btn btn-primary btn-block">Create Account</button>
</div>
{% if connect_with_proton %}
<div class="text-center my-2 text-gray">
<span>or</span>
</div>
<a class="btn btn-primary btn-block mt-2 proton-button"
href="{{ url_for("auth.proton_login", next=next_url) }}">
<img class="mr-2" src="/static/images/proton.svg" />
Sign up with Proton
</a>
{% endif %}
</div>
</form>
<div class="text-center text-muted mb-6">
Already have account?
<a href="{{ url_for('auth.login') }}">Sign in</a>
</div>
{% endblock %}

View File

@ -0,0 +1,13 @@
{% extends "single.html" %}
{% block title %}Activation Email Sent{% endblock %}
{% block single_content %}
<div class="card">
<div class="card-body p-6 text-center">
<h1 class="h4">An email to validate your email is on its way.</h1>
<p>Please check your inbox/spam folder.</p>
</div>
</div>
{% endblock %}
{% block script %}<script>plausible('Complete registration')</script>{% endblock %}

View File

@ -0,0 +1,24 @@
{% extends "single.html" %}
{% block title %}Resend activation email{% endblock %}
{% block single_content %}
<form class="card" method="post">
{{ form.csrf_token }}
<div class="card-body p-6">
<div class="card-title">Resend activation email</div>
<div class="form-group">
<label class="form-label">Email address</label>
{{ form.email(class="form-control", type="email") }}
{{ render_field_errors(form.email) }}
</div>
<div class="form-footer">
<button type="submit" class="btn btn-primary btn-block">Resend</button>
</div>
</div>
</form>
<div class="text-center text-muted">
Don't have account yet?
<a href="{{ url_for('auth.register') }}">Sign up</a>
</div>
{% endblock %}

View File

@ -0,0 +1,21 @@
{% extends "single.html" %}
{% block title %}Reset password{% endblock %}
{% block single_content %}
{% if error %}<div class="text-danger text-center mb-4">{{ error }}</div>{% endif %}
<form class="card" method="post">
{{ form.csrf_token }}
<div class="card-body p-6">
<div class="card-title">Reset your password</div>
<div class="form-group">
<label class="form-label">Password</label>
{{ form.password(class="form-control", type="password") }}
{{ render_field_errors(form.password) }}
</div>
<div class="form-footer">
<button type="submit" class="btn btn-primary btn-block">Reset</button>
</div>
</div>
</form>
{% endblock %}

View File

@ -0,0 +1,46 @@
{% extends "single.html" %}
{% block title %}Social Login{% endblock %}
{% block single_content %}
<div class="card">
<div class="card-body p-6">
<div class="card-title text-center">Social login</div>
{% if GITHUB_CLIENT_ID %}
<a href="{{ url_for('auth.github_login', next=next_url) }}"
class="btn btn-block btn-social btn-github">
<i class="fa fa-github"></i> Sign in with GitHub
</a>
{% endif %}
{% if GOOGLE_CLIENT_ID %}
<a href="{{ url_for('auth.google_login', next=next_url) }}"
class="btn btn-block btn-social btn-google">
<i class="fa fa-google"></i> Sign in with Google
</a>
{% endif %}
{% if FACEBOOK_CLIENT_ID %}
<a href="{{ url_for('auth.facebook_login', next=next_url) }}"
class="btn btn-block btn-social btn-facebook">
<i class="fa fa-facebook"></i> Sign in with Facebook
</a>
{% endif %}
</div>
<div class="text-center p-3"
style="font-size: 12px; font-weight: 300; margin: auto">
<span class="badge badge-warning">Warning</span>
Please note that social login is now <b>deprecated</b>.
<br />
<br />
Though practical, these social providers do not respect your privacy and therefore we recommend using
email/password.
</div>
</div>
<div class="text-center text-muted mt-2">
<a href="{{ url_for('auth.register') }}">Sign up</a>
/
<a href="{{ url_for('auth.login') }}">Login</a>
</div>
{% endblock %}