예제 #1
0
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)
예제 #2
0
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)
예제 #3
0
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)
예제 #4
0
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)
예제 #5
0
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)
예제 #6
0
def login():
    if session.get('user_id', None) is None:
        return github.authorize('public_repo')
    else:
        return redirect(url_for('index'))
예제 #7
0
def login():
    if session.get('user_id', None) is None:
        return github.authorize('public_repo')
    else:
        return u'Already logged in'
예제 #8
0
def login():
    if session.get('user_id', None) is None:
        return github.authorize('public_repo')
    else:
        return u'Already logged in'
예제 #9
0
def login():
    if session.get('user_id', None) is None:
        return github.authorize('public_repo')
    else:
        return redirect(g.referer)
예제 #10
0
def login():
    if session.get('user_id', None) is None:
        return github.authorize('public_repo')
    else:
        return redirect(g.referer)