Example #1
0
def test_adds_auth_endpoint():
    app = Flask(__name__)
    app.config["SECRET_KEY"] = "super-secret"
    app.config["JWT_AUTH_URL_RULE"] = "/auth"
    app.config["JWT_AUTH_ENDPOINT"] = "jwt_auth"
    flask_jwt.JWT(app)
    rules = [str(r) for r in app.url_map._rules]
    assert "/auth" in rules
Example #2
0
# -*- coding: utf-8 -*-
from flask import Flask , jsonify, request
from flask_jwt import JWT
from datetime import datetime, timedelta
import os

app = Flask(__name__)
app.config["SECRET_KEY"] = os.environ.get('SECRET_KEY')
app.config["JWT_AUTH_URL_RULE"] = "/login"
app.config['JWT_EXPIRATION_DELTA'] = timedelta(minutes=int(600))

jwt = JWT(app)

import gsenhaapi.view.routes