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