Skip to content

chrisK824/fastapi-forgot-password-example

Repository files navigation

fastapi-forgot-password-example

Forgot password example flow with FastAPI

Installation

  • 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

Usage

Create fist admin manually

  • 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

Endpoints requests

All endpoints can be used by visiting the swagger documentation at localhost:9999/v1/documentation

About

Forgot password example flow with FastAPI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published