main
Module Contents
Functions
Called on startup, creates the database tables if they do not exist |
|
|
Reads data from the login form and returns a token if the user is valid |
|
Registers a new user |
|
Returns the current user |
Attributes
- main.app
- main.on_startup()
Called on startup, creates the database tables if they do not exist
- async main.login_for_access_token(form_data=Depends(), session=Depends(get_session))
Reads data from the login form and returns a token if the user is valid
- Parameters
form_data (fastapi.security.OAuth2PasswordRequestForm) – data sent by the client
session (dependencies.Session) – database session from dependencies
- Returns
token
- main.register(user, session=Depends(get_session))
Registers a new user
- Parameters
user (dependencies.User) – user to add to the database
session (dependencies.Session) – database session from dependencies
- Returns
user
- main.get_current_user(user=Depends(get_current_active_user))
Returns the current user
- Parameters
user (dependencies.User) – active user from dependencies
- Returns
user