我正在我的项目中实现JWT。我实现了jwt,并将过期时间设置为1分钟。api端生成的jwt在登录过程中,token和过期详细信息将在结果中发送并存储在本地存储中。如何从API端刷新过期的token,并将其重新发送回客户端,以便将其存储在本地存储中,并使用interceptor为每次调用发送?
这就是我创建jwt并给出过期时间的方法
// let us suppose this is my input
tokenObject = { User: { username: name, pwd: pwd } };
//creating a jwt here
jwt.sign({ tokenObject
我正在尝试创建一个更新帐户视图,当用户单击更新时,我正在刷新令牌,并获取jwt身份。 但是,jwt身份没有更改,用户保持与更新前相同。数据库正在更新,但jwt标识没有更新。 那么我该如何更新身份呢?如果我只有当前jwt令牌和刷新令牌。 以下是我的路线 @app.route('/current-user', methods=['GET'])
@jwt_required
def get_current_user():
# Access the identity of the current user with get_jwt_identity
tr
我正在使用python flask_jwt_extended来处理jwt。我有一个刷新端点(来自文档),如下所示:
# The jwt_refresh_token_required decorator insures a valid refresh
# token is present in the request before calling this endpoint. We
# can use the get_jwt_identity() function to get the identity of
# the refresh token, and use the create_acc