def login(): next_url = request.args.get('next') or url_for('index') if session.get('user_id', None) is None: session['next_url'] = next_url return github.authorize('public_repo') else: return redirect(next_url)
def login(): if session.get("user_id", None) is None: # manually set the referer so we know where to come back to # when we return from GitHub set_referer(request) return github.authorize("public_repo") else: return redirect(g.referer)
def login(): if session.get('user_id', None) is None: # manually set the referer so we know where to come back to # when we return from GitHub set_referer(request) return github.authorize('public_repo') else: return redirect(g.referer)
def login(): if session.get('user_id', None) is None: if app.config['TESTING']: session['username'] = '******' session['avatar_url'] = '/test-files/fixtures/avatar.png?' return authorized() else: # manually set the referer so we know where to come back to # when we return from GitHub set_referer(request) return github.authorize('public_repo') else: return redirect(g.referer)
def login(): """Set the login route.""" if session.get('user_id', None) is None: if app.config['TESTING']: session['username'] = '******' session['avatar_url'] = '/test-files/fixtures/avatar.png?' return authorized() else: # manually set the referer so we know where to come back to # when we return from GitHub set_referer(request) return github.authorize('public_repo') else: return redirect(g.referer)
def login(): if session.get('user_id', None) is None: return github.authorize('public_repo') else: return redirect(url_for('index'))
def login(): if session.get('user_id', None) is None: return github.authorize('public_repo') else: return u'Already logged in'
def login(): if session.get('user_id', None) is None: return github.authorize('public_repo') else: return redirect(g.referer)