示例#1
0
def login():
    if current_user.is_authenticated:
        return redirect(url_for('index'))
    form = SigninForm()
    if form.validate_on_submit():
        login_user_bundle(form.user)
        return form.redirect('index')
    return render_template('login.html', form=form)
示例#2
0
文件: session_mgmt.py 项目: JARR/JARR
def login():
    if current_user.is_authenticated:
        return redirect(url_for('home'))
    form = SigninForm()
    if form.validate_on_submit():
        login_user_bundle(form.user)
        return form.redirect('home')
    return render_template('login.html', form=form)
def login():
    if current_user.is_authenticated:
        return redirect(url_for('admin_bp.list_logs'))
    form = SigninForm()
    if form.validate_on_submit():
        login_user(form.user)
        identity_changed.send(current_app, identity=Identity(form.user.id))
        session_identity_loader()
        return form.redirect()
    return render_template('index.html', form=form, releases=RELEASES)
示例#4
0
文件: views.py 项目: bzero/JARR
def login():
    """
    Log in view.
    """
    if g.user is not None and g.user.is_authenticated:
        return redirect(url_for('home'))
    g.user = AnonymousUserMixin()
    form = SigninForm()
    if form.validate_on_submit():
        user = UserController().get(email=form.email.data)
        login_user(user)
        g.user = user
        session['email'] = form.email.data
        identity_changed.send(current_app._get_current_object(),
                              identity=Identity(user.id))
        return form.redirect('home')
    return render_template('login.html', form=form)
示例#5
0
def login():
    """
    Log in view.
    """
    if g.user is not None and g.user.is_authenticated:
        return redirect(url_for('home'))
    g.user = AnonymousUserMixin()
    form = SigninForm()
    if form.validate_on_submit():
        user = UserController().get(email=form.email.data)
        login_user(user)
        g.user = user
        session['email'] = form.email.data
        identity_changed.send(current_app._get_current_object(),
                              identity=Identity(user.id))
        return form.redirect('home')
    return render_template('login.html', form=form)