Skip to main content

Email Authentication

Abstra's SDK provides the get_user() method, a self contained authentication system that allows email verification and access restriction within your Form's logic.

To restrict access to specific users, add logic such as specifying an email domain or a selected list of emails.

Function definition

def get_user() -> User

# User: { email: str }

Example

import abstra.forms as af

auth_info = af.get_user()
email = auth_info.email

if not email.endswith('@example.com'):
af.display('🧙 You shall not pass!')
exit()

tip

The email is only sent in production. The local version will accept any text as token.