You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an easy and fast way to create APIs for Authentication (Signup, Signin, Forget Password) using Flask
Steps to initialize the app
Clone the repository
Install the requirements from requirements.txt file
Run the app - python3 main.py
Components of project
1. main.py - This is the main file which contains the app and all the routes.
2. models.py - This file contains the models for the database.
3. database.db - This is an SQLITE database file.
Testing APIs using POSTMAN
Endpoint: /api/v1/usermng/signup
Storing the username, email, password. Password is stored using encryption including salts and hashing technique. Hashing is irreversible therefore, the password once stored cannot be decrypted again.
Endpoint: /api/v1/usermng/signin
Checking the email and password from the database. If the email and password matches, then the user is logged in. Else the error message is returned.
Endpoint: /api/v1/usermng/forgetPassword
There are different techniques for forget password or reset password like token using JWT(JSON Web Token) or OTP(One Time Password). I used a simple way to identify the user, by asking the user about the data we have like its username or DoB for authorization, then email user the new password.
Endpoint: /api/v1/usermng/resetPassword
Checking the email and password from the database. If the email and password matches, then setting the new_password. Else the error message is returned.