def authorized(resp, remote):
    """Authorized callback handler for GitHub.

    :param resp: The response.
    :param remote: The remote application.
    """
    if resp and 'error' in resp:
        if resp['error'] == 'bad_verification_code':
            # See https://developer.github.com/v3/oauth/#bad-verification-code
            # which recommends starting auth flow again.
            return redirect(url_for('invenio_oauthclient.login',
                                    remote_app='github'))
        elif resp['error'] in ['incorrect_client_credentials',
                               'redirect_uri_mismatch']:
            raise OAuthResponseError(
                'Application mis-configuration in GitHub', remote, resp
            )

    return authorized_signup_handler(resp, remote)
def authorized ( resp , remote ) : if resp and 'error' in resp : if resp [ 'error' ] == 'bad_verification_code' : return redirect ( url_for ( 'invenio_oauthclient.login' , remote_app = 'github' ) ) elif resp [ 'error' ] in [ 'incorrect_client_credentials' , 'redirect_uri_mismatch' ] : raise OAuthResponseError ( 'Application mis-configuration in GitHub' , remote , resp ) return authorized_signup_handler ( resp , remote )
Authorized callback handler for GitHub.

    :param resp: The response.
    :param remote: The remote application.