小编Jsm*_*idt的帖子

Flask-JWT-Extended - 错误的授权标头

我正在使用以下代码来测试 Flask JWT。

from flask import Flask, jsonify, request
from flask_jwt_extended import (
    JWTManager, jwt_required, create_access_token,
    get_jwt_identity
)

app = Flask(__name__)

# Setup the Flask-JWT-Extended extension
app.config['JWT_SECRET_KEY'] = 'super-secret'  # Change this!
jwt = JWTManager(app)


# Provide a method to create access tokens. The create_access_token()
# function is used to actually generate the token, and you can return
# it to the caller however you choose.
@app.route('/login', methods=['POST'])
def login():
    if not request.is_json:
        return jsonify({"msg": "Missing JSON in request"}), 400 …
Run Code Online (Sandbox Code Playgroud)

flask jwt

2
推荐指数
1
解决办法
4770
查看次数

标签 统计

flask ×1

jwt ×1