예제 #1
0
파일: views.py 프로젝트: svven/web
def oauth_callback(provider_name):
    if not current_user.is_anonymous():
        return redirect(url_for('home.page'))
    oauth = OAuth.get_provider(provider_name)
    try:
        user_credentials = oauth.callback()
        if user_credentials is None:
            raise
    except Exception, e:
        current_app.logger.exception(e)
        flash('Oops, could not authenticate you, sorry.', 'danger')
        return redirect(url_for('front.page'))
예제 #2
0
파일: views.py 프로젝트: svven/web
def oauth_authorize(provider_name):
    if not current_user.is_anonymous():
        return redirect(url_for('home.page'))
    oauth = OAuth.get_provider(provider_name)
    return oauth.authorize()