mirror of
https://github.com/fastapi-users/fastapi-users.git
synced 2025-08-21 09:02:25 +08:00
Automated deployment: Fri Feb 7 07:02:21 UTC 2020 6607d968ff931260ca024aa7aea3e9bbf3d2ac01
This commit is contained in:
@ -5,6 +5,7 @@ from fastapi_users import FastAPIUsers, models
|
||||
from fastapi_users.authentication import JWTAuthentication
|
||||
from fastapi_users.db import SQLAlchemyBaseUserTable, SQLAlchemyUserDatabase
|
||||
from sqlalchemy.ext.declarative import DeclarativeMeta, declarative_base
|
||||
from starlette.requests import Request
|
||||
|
||||
DATABASE_URL = "sqlite:///./test.db"
|
||||
SECRET = "SECRET"
|
||||
@ -55,12 +56,12 @@ app.include_router(fastapi_users.router, prefix="/users", tags=["users"])
|
||||
|
||||
|
||||
@fastapi_users.on_after_register()
|
||||
def on_after_register(user: User):
|
||||
def on_after_register(user: User, request: Request):
|
||||
print(f"User {user.id} has registered.")
|
||||
|
||||
|
||||
@fastapi_users.on_after_forgot_password()
|
||||
def on_after_forgot_password(user: User, token: str):
|
||||
def on_after_forgot_password(user: User, token: str, request: Request):
|
||||
print(f"User {user.id} has forgot their password. Reset token: {token}")
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user