Exemplo n.º 1
0
def logout():
    claims = get_jwt_claims()
    user = User.from_claims(claims)
    try:
        logout_user(user.email)
        response_object = {'status': 'logged out'}
        return make_response(jsonify(response_object)), 201
    except Exception as e:
        response_object = {'error': {'internal': str(e)}}
        return make_response(jsonify(response_object)), 401
Exemplo n.º 2
0
def logout():
    claims = get_jwt_claims()
    user = User.from_claims(claims)
    try:
        logout_user(user.email)
        response_object = {"status": "logged out"}
        return make_response(jsonify(response_object)), 201
    except Exception as e:
        response_object = {"error": {"internal": str(e)}}
        return make_response(jsonify(response_object)), 401
Exemplo n.º 3
0
def test_logout(client):
    result = logout_user(test_user.get('email'))
    assert result == {'success': True}
    session_result = get_user_session(test_user.get('email'))
    assert session_result is None
Exemplo n.º 4
0
def test_logout(client):
    result = logout_user(test_user.get("email"))
    assert result == {"success": True}
    session_result = get_user_session(test_user.get("email"))
    assert session_result is None