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 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_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 post(self): jti = fjwte.get_raw_jwt()['jti'] revoked_token = RevokedTokenModel(jti=jti) revoked_token.save() return {'message': 'Refresh token has been revoked'}
def check_if_token_in_blacklist(decrypted_token): jti = decrypted_token['jti'] return RevokedTokenModel.is_jti_blacklisted(jti)
def revoke_token(self, jti): revoked_token = RevokedTokenModel(jti=jti) revoked_token.save_to_db()
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