Esempio n. 1
0
def oauth_auth_success(client, redirect_uri, state, code):
    """
    Commit session and redirect to OAuth redirect URI
    """
    if client.trusted:
        save_flashed_messages()
    else:
        clear_flashed_messages()
    db.session.commit()
    if state is None:
        return redirect(make_redirect_url(redirect_uri, code=code), code=302)
    else:
        return redirect(make_redirect_url(redirect_uri, code=code, state=state), code=302)
Esempio n. 2
0
def oauth_auth_success(client, redirect_uri, state, code):
    """
    Commit session and redirect to OAuth redirect URI
    """
    if client.trusted:
        save_flashed_messages()
    else:
        clear_flashed_messages()
    db.session.commit()
    if state is None:
        response = redirect(make_redirect_url(redirect_uri, code=code), code=302)
    else:
        response = redirect(make_redirect_url(redirect_uri, code=code, state=state), code=302)
    response.headers['Cache-Control'] = 'no-store'
    response.headers['Pragma'] = 'no-cache'
    return response
Esempio n. 3
0
def oauth_auth_success(client, redirect_uri, state, code):
    """
    Commit session and redirect to OAuth redirect URI
    """
    if client.trusted:
        save_flashed_messages()
    else:
        clear_flashed_messages()
    db.session.commit()
    if state is None:
        response = redirect(make_redirect_url(redirect_uri, code=code), code=302)
    else:
        response = redirect(make_redirect_url(redirect_uri, code=code, state=state), code=302)
    response.headers['Cache-Control'] = 'no-store'
    response.headers['Pragma'] = 'no-cache'
    return response
Esempio n. 4
0
def oauth_auth_error(redirect_uri, state, error, error_description=None, error_uri=None):
    """
    Auth request resulted in an error. Return to client.
    """
    params = {'error': error}
    if state is not None:
        params['state'] = state
    if error_description is not None:
        params['error_description'] = error_description
    if error_uri is not None:
        params['error_uri'] = error_uri
    clear_flashed_messages()
    return redirect(make_redirect_url(redirect_uri, **params), code=302)
Esempio n. 5
0
def oauth_auth_error(redirect_uri, state, error, error_description=None, error_uri=None):
    """
    Auth request resulted in an error. Return to client.
    """
    params = {'error': error}
    if state is not None:
        params['state'] = state
    if error_description is not None:
        params['error_description'] = error_description
    if error_uri is not None:
        params['error_uri'] = error_uri
    clear_flashed_messages()
    response = redirect(make_redirect_url(redirect_uri, **params), code=302)
    response.headers['Cache-Control'] = 'no-store'
    response.headers['Pragma'] = 'no-cache'
    return response
Esempio n. 6
0
def oauth_auth_error(redirect_uri, state, error, error_description=None, error_uri=None):
    """
    Auth request resulted in an error. Return to client.
    """
    params = {'error': error}
    if state is not None:
        params['state'] = state
    if error_description is not None:
        params['error_description'] = error_description
    if error_uri is not None:
        params['error_uri'] = error_uri
    clear_flashed_messages()
    response = redirect(make_redirect_url(redirect_uri, **params), code=302)
    response.headers['Cache-Control'] = 'no-store'
    response.headers['Pragma'] = 'no-cache'
    return response