def METHOD_NAME(flask_client):
    email = random_email()
    User.create(email=email, password="password", name="Test User", activated=True)
    Session.commit()
    r = flask_client.post(
        url_for("api.auth_login"),
        json={
            "email": email,
            "password": "password",
            "device": "Test Device",
        },
    )
    assert r.status_code == 200
    api_key = r.json["api_key"]
    assert not r.json["mfa_enabled"]
    assert r.json["mfa_key"] is None
    assert r.json["name"] == "Test User"
    # same device, should return same api_key
    r = flask_client.post(
        url_for("api.auth_login"),
        json={
            "email": email,
            "password": "password",
            "device": "Test Device",
        },
    )
    assert r.json["api_key"] == api_key