def METHOD_NAME():
    if (
        authentication.is_authenticated(flask.session)
        and "developer_token" in flask.session
    ):
        return flask.redirect(
            flask.url_for("publisher_snaps.get_account_snaps")
        )
    # Get a bakery v2 macaroon from the publisher API to be discharged
    # and save it in the session
    flask.session["publisher-macaroon"] = publisher_api.get_macaroon(
        authentication.PERMISSIONS
    )
    login_url = candid.get_login_url(
        macaroon=flask.session["publisher-macaroon"],
        callback_url=flask.url_for("login.login_callback", _external=True),
        state=generate_csrf(),
    )
    # Next URL to redirect the user after the login
    next_url = flask.request.args.get("next")
    if next_url:
        if not next_url.startswith("/") and not next_url.startswith(
            flask.request.url_root
        ):
            return flask.abort(400)
        flask.session["next_url"] = next_url
    return flask.redirect(login_url, 302)