Skip to content

Instantly share code, notes, and snippets.

View HemantSachdeva's full-sized avatar
:octocat:
FooBar

Hemant Sachdeva HemantSachdeva

:octocat:
FooBar
View GitHub Profile
@HemantSachdeva
HemantSachdeva / login.py
Created December 25, 2022 12:34 — forked from shayff/login.py
from flask import Flask, request, jsonify
from flask_jwt_extended import create_access_token, JWTManager
import datetime
import hashlib
jwt = JWTManager(app) # initialize JWTManager
app.config['JWT_SECRET_KEY'] = 'Your_Secret_Key'
app.config['JWT_ACCESS_TOKEN_EXPIRES'] = datetime.timedelta(days=1) # define the life span of the token
@app.route("/api/v1/login", methods=["post"])