Login

{% if error %}

Error

{{ msg }}

{% end %} {% try %}{% set user = handler.kwargs.user.arg %}{% except %}{% set user = 'user' %}{% end %} {% try %}{% set password = handler.kwargs.password.arg %}{% except %}{% set password = 'password' %}{% end %} {% if email is None and otp is None %}

I already have the OTP

{% else %} {% if handler.request.method == 'POST' %}

We sent an email to {{ email }} with an OTP and link to log in.

Once you receive the OTP, enter it below.

{% end %}

{# Preserve the redirect URL #} {# ?user= takes the user to the OTP screen (not email screen) in case the OTP is wrong #} {# ?_= enables instantlogin #}

Request new OTP

{% end %} {% if 'recaptcha' in handler.kwargs %} {% import os, gramex.config %} {% set recaptcha_path = os.path.join(gramex.config.variables['GRAMEXPATH'], 'handlers', 'auth.recaptcha.template.html') %} {% module Template(recaptcha_path, kwargs=handler.kwargs) %} {% end %}