Exemple #1
0
    def POST(self):
        name, pwd = web.input().username, web.input().password
        user = models.User.get(username=name)
        if not user:
            return render.login(is_loggedin(), True)

        if bcrypt.verify(pwd, user.password):
            raise authorize(user)
        return render.login(is_loggedin(), True)
Exemple #2
0
    def POST(self):
        name, pwd = web.input().username, web.input().password
        user = models.User.get(username=name)
        if not user:
            return render.login(is_loggedin(), True)

        if bcrypt.verify(pwd, user.password):
            raise authorize(user)
        return render.login(is_loggedin(), True)
Exemple #3
0
 def GET(self):
     form = RegisterForm()
     return render.register(form, is_loggedin())
Exemple #4
0
 def GET(self):
     return render.login(is_loggedin())
Exemple #5
0
 def GET(self):
     if is_loggedin():
         session.kill()
     raise web.seeother('/login')
Exemple #6
0
 def f(*args, **kwargs):
     if not is_loggedin():
         raise web.seeother('/login')
     return func(*args, **kwargs)
Exemple #7
0
 def GET(self):
     form = RegisterForm()
     return render.register(form, is_loggedin())
Exemple #8
0
 def GET(self):
     return render.login(is_loggedin())
Exemple #9
0
 def GET(self):
     if is_loggedin():
         session.kill()
     raise web.seeother('/login')