(request: HttpRequest)
return HttpResponseRedirect(str(oauth_url))
Entry point to oauth flow.

    We keep this as a simple endpoint on the API to redirect users to from the
    frontend. This way we keep complexity within the API.

    https://developer.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#1-request-a-users-github-identity
Entry point to oauth flow.
Entry point to oauth flow .
def oauth_login(request: HttpRequest) -> HttpResponse:
    """
    Entry point to oauth flow.

    We keep this as a simple endpoint on the API to redirect users to from the
    frontend. This way we keep complexity within the API.

    https://developer.github.com/apps/building-github-apps/identifying-and-authorizing-users-for-github-apps/#1-request-a-users-github-identity
    """
    state = request.GET.get("state")
    if not state:
        return HttpResponseBadRequest("Missing required state parameter")
    oauth_url = URL("https://github.com/login/oauth/authorize").with_query(
        dict(
            client_id=settings.KODIAK_API_GITHUB_CLIENT_ID,
            redirect_uri=settings.KODIAK_WEB_AUTHED_LANDING_PATH,
            state=state,
        )
    )
    return HttpResponseRedirect(str(oauth_url))
def oauth_login ( request : HttpRequest ) -> HttpResponse : state = request . GET . get ( "state" ) if not state : return HttpResponseBadRequest ( "Missing required state parameter" ) oauth_url = URL ( "https://github.com/login/oauth/authorize" ) . with_query ( dict ( client_id = settings . KODIAK_API_GITHUB_CLIENT_ID , redirect_uri = settings . KODIAK_WEB_AUTHED_LANDING_PATH , state = state , ) ) return HttpResponseRedirect ( str ( oauth_url ) )