Ejemplo n.º 1
0
 def post(self):
     jti = get_raw_jwt()['jti']
     try:
         revoked_token = RevokedTokenModel(jti=jti)
         revoked_token.add()
         return {'message': 'Refresh token has been revoked'}
     except:
         return {'message': 'Something went wrong.'}, 500
Ejemplo n.º 2
0
def do_player_logout_access():
    jti = get_raw_jwt()['jti']
    try:
        revoked_token = RevokedTokenModel(jti=jti)
        revoked_token.add()
        return {'status': 'success'}
    except:
        return {'message': 'Something went wrong'}, 500
Ejemplo n.º 3
0
def do_player_logout_refresh():
    jti = get_raw_jwt()['jti']
    try:
        revoked_token = RevokedTokenModel(jti=jti)
        revoked_token.add()
        return {'message': 'Refresh token has been revoked'}
    except:
        return {'message': 'Something went wrong'}, 500
Ejemplo n.º 4
0
 def post(self):
     jti = get_raw_jwt()['jti']
     print(jti)
     try:
         revoked_token = RevokedTokenModel(jti = jti)
         print(1)
         revoked_token.add()
         return {'message': 'Access token has been revoked'}
     except:
         return {'message': 'Something went wrong'}, 500
Ejemplo n.º 5
0
    def post(self):
        current_username = get_jwt_identity()['username']
        current_user = User.find_by_username(current_username)
        current_user.active = False
        current_user.save_to_db()

        jti = get_raw_jwt()['jti']
        try:
            revoked_token = RevokedTokenModel(jti = jti)
            revoked_token.add()
            return {'message': 'Access token has been revoked'}
        except:
            return {'message': 'Something went wrong'}, 500
 def post(self):
     jti = get_raw_jwt()['jti']
     try:
         revoked_token = RevokedTokenModel(jti=jti)
         revoked_token.add()
         return {
             'message': 'Access token has been revoked',
             'status': 'Success'
         }
     except:
         return {
             'message': 'Access token revoking went wrong',
             'status': 'Failure'
         }, 500
Ejemplo n.º 7
0
def logout_refresh_token():
    jti = get_raw_jwt()["jti"]
    revoked_token = RevokedTokenModel(jti=jti)
    revoked_token.add()
    return jsonify({"msg": "Successfully logged out"}), 200
Ejemplo n.º 8
0
def delete_refreshtoken():
    jti = get_raw_jwt()['jti']
    revoked_token = RevokedTokenModel(jti=jti)
    revoked_token.add()
    return '', 204