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 #}

{% if 'recaptcha' in handler.kwargs %} {% import os, gramex.cache, gramex.handlers %} {{ gramex.cache.open(os.path.join(gramex.handlers._folder, 'auth.recaptcha.template.html'), 'text') }} {% end %}

Request new OTP

{% end %}