Beispiel #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)
Beispiel #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)
Beispiel #3
0
 def GET(self):
     form = RegisterForm()
     return render.register(form, is_loggedin())
Beispiel #4
0
 def GET(self):
     return render.login(is_loggedin())
Beispiel #5
0
 def GET(self):
     if is_loggedin():
         session.kill()
     raise web.seeother('/login')
Beispiel #6
0
 def f(*args, **kwargs):
     if not is_loggedin():
         raise web.seeother('/login')
     return func(*args, **kwargs)
Beispiel #7
0
 def GET(self):
     form = RegisterForm()
     return render.register(form, is_loggedin())
Beispiel #8
0
 def GET(self):
     return render.login(is_loggedin())
Beispiel #9
0
 def GET(self):
     if is_loggedin():
         session.kill()
     raise web.seeother('/login')