Skip to main content

Get User

Abstra's SDK provides the get_user() method, which prompts the user to log in (if not already) and returns an object with the user's email.

info

While editing your project, you can use any email to log in. Verification codes are not sent and any value will be validated.

Function definition

def get_user() -> User

# User: { email: str }

Example

import abstra.forms as af

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

af.display(f"{email} is logged in! ✨")

tip

Check out the Access Control concepts page to learn more about how to manage users and roles in your project.