コード例 #1
0
ファイル: oauth.py プロジェクト: vdedyukhin/lookatthis
def authenticate():
    """
    Run OAuth workflow.
    """
    from flask import request
    response = make_response()
    context = make_context()

    result = authomatic.login(WerkzeugAdapter(request, response), 'google')

    if result:
        context['result'] = result

        if not result.error:
            save_credentials(result.user.credentials)

        return render_template('oauth/authenticate.html', **context)

    return response
コード例 #2
0
ファイル: oauth.py プロジェクト: BenHeubl/lookatthis
def authenticate():
    """
    Run OAuth workflow.
    """
    from flask import request

    response = make_response()
    context = make_context()

    result = authomatic.login(WerkzeugAdapter(request, response), "google")

    if result:
        context["result"] = result

        if not result.error:
            save_credentials(result.user.credentials)

        return render_template("oauth/authenticate.html", **context)

    return response
コード例 #3
0
ファイル: oauth.py プロジェクト: WindMiner/dailygraphics
def authenticate():
    """
    Run OAuth workflow.
    """
    from flask import request
    response = make_response()
    context = make_context()

    if not _has_api_credentials():
        return render_template('oauth/warning.html', **context)

    result = authomatic.login(WerkzeugAdapter(request, response), 'google')

    if result:
        context['result'] = result

        if not result.error:
            save_credentials(result.user.credentials)

        return render_template('oauth/authenticate.html', **context)

    return response
コード例 #4
0
def authenticate():
    """
    Run OAuth workflow.
    """
    from flask import request
    response = make_response()
    context = make_context()

    if not _has_api_credentials():
        return render_template('oauth/warning.html', **context)

    result = authomatic.login(WerkzeugAdapter(request, response), 'google')

    if result:
        context['result'] = result

        if not result.error:
            save_credentials(result.user.credentials)
            get_document(app_config.COPY_GOOGLE_DOC_KEY, app_config.COPY_PATH)

        return render_template('oauth/authenticate.html', **context)

    return response
コード例 #5
0
ファイル: blueprint.py プロジェクト: katlonsdorf/elections16
def authenticate():
    """
    Run OAuth workflow.
    """
    from flask import request
    response = make_response()
    context = make_context()

    if not _has_api_credentials():
        return render_template('warning.html', **context)

    result = authomatic.login(WerkzeugAdapter(request, response), 'google')

    if result:
        context['result'] = result

        if not result.error:
            save_credentials(result.user.credentials)
            get_spreadsheet(app_config.COPY_GOOGLE_DOC_KEY, app_config.COPY_PATH)

        return render_template('authenticate.html', **context)

    return response