Exemplo n.º 1
0
def login():
    form = AccountForm.LoginForm()
    if request.method == 'GET' :
        if g.user.is_authenticated() == False:
            return render_template('login.html', form=form)
        if g.user.is_authenticated():
            return redirect(url_for('index'))
            
    return AccountController.authenticate(form = form)
Exemplo n.º 2
0
def login():
    form = AccountForm.LoginForm()
    if request.method == "GET":
        # Check if user is already logged in, return login page if not, otherwise index
        if g.user.is_authenticated() == False:
            return render_template("login.html", form=form, formLogin=form)
        if g.user.is_authenticated():
            return redirect(url_for("index"))

    return AccountController.authenticate(form=form)