Forgot password example flow with FastAPI
python3.11 -m venv python_venv
source python_venv/bin/activate
pip install -r requirements.txt
python3.11 main.py
- Create an .env file to add environment variables needed Example:
SECRET_KEY=some_secret_key
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=60
[email protected]
SENDER_GMAIL_PASSWORD=<your_google_app_password here>
Tutorial at: https://medium.com/itnext/fastapi-forgot-password-mechanism-end-to-end-74c068fd73bd
INSERT INTO users (email,password,name,surname, role) VALUES('[email protected]', '$2b$12$tLGdEP/3.B.sFTNITAfX5uLDzs6kgXq1PU8yxP/EnFIPBBWsvR4HG', 'Admin name', 'Admin surname', 'ADMINISTRATOR');
- user created:
[email protected]
|1234
All endpoints can be used by visiting the swagger documentation at localhost:9999/v1/documentation