Exemplo n.º 1
0
def login_return():
    if 'code' in request.args:
        code = LoginCode.query.filter_by(code=request.args['code']).first()
        if code and code.user:
            session['userid'] = code.user.userid
            lookup_current_user(code.user)
            signal_login.send(eventapp, user=code.user)
            db.session.delete(code)
            db.session.commit()
            return redirect(code.next_url or url_for('index'))
        elif code:
            db.session.delete(code)
            db.session.commit()
    abort(403)
Exemplo n.º 2
0
def login_return():
    if 'code' in request.args:
        code = LoginCode.query.filter_by(code=request.args['code']).first()
        if code and code.user:
            session['userid'] = code.user.userid
            lookup_current_user(code.user)
            signal_login.send(eventapp, user=code.user)
            db.session.delete(code)
            db.session.commit()
            return redirect(code.next_url or url_for('index'))
        elif code:
            db.session.delete(code)
            db.session.commit()
    abort(403)
Exemplo n.º 3
0
def lastuserauth():
    # Save the user object
    signal_login.send(app, user=g.user)
    db.session.commit()
    return redirect(get_next_url())
Exemplo n.º 4
0
def lastuserauth():
    # Save the user object
    signal_login.send(app, user=g.user)
    db.session.commit()
    return redirect(get_next_url())