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
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
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
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
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
def logout_refresh_token(): jti = get_raw_jwt()["jti"] revoked_token = RevokedTokenModel(jti=jti) revoked_token.add() return jsonify({"msg": "Successfully logged out"}), 200
def delete_refreshtoken(): jti = get_raw_jwt()['jti'] revoked_token = RevokedTokenModel(jti=jti) revoked_token.add() return '', 204