def post(self): params = self.get_params(["username", "password"]) log_token = aut.valid_login(*params) if log_token: username, _ = params self.set_cookies({"username": username, "log_token": log_token}) self.redirect("/") else: self.redirect("/login")
def post(self): params = self.get_params(["username", "password"]) log_token = aut.valid_login(*params) if log_token: username, _ = params self.set_cookies({"username":username, "log_token":log_token}) self.redirect("/") else: self.redirect("/login")
def post(self): params = self.get_params(["username", "email", "password"]) user = User.save(*params) if user: log_token = aut.create_and_save_log_token(user) self.set_cookies({"username": user.username, "log_token": log_token}) self.redirect("/") else: self.redirect("/signup")
def post(self): #TODO: what if i'm already logged in params = self.get_params(["username", "password"]) log_token = aut.valid_login(*params) if log_token: username, _ = params self.set_cookies({"username": username, "log_token": log_token}) self.redirect("/") else: errors = get_login_errors(*params) self.render("login.html", {'errors': errors})
def post(self): #TODO: works with non-matching passwords, it shouldn't params = self.get_params(["username", "email", "password", "password_confirm"]) user = User.save(*params) if user: log_token = aut.create_and_save_log_token(user) self.set_cookies({'username':user.username, 'log_token':log_token}) self.redirect("/") else: _, errors = valid(*params) self.render("signup.html", {'errors': errors})
def post(self): params = self.get_params(["username", "email", "password"]) user = User.save(*params) if user: log_token = aut.create_and_save_log_token(user) self.set_cookies({ 'username': user.username, 'log_token': log_token }) self.redirect("/") else: self.redirect("/signup")
def post(self): #TODO: works with non-matching passwords, it shouldn't params = self.get_params( ["username", "email", "password", "password_confirm"]) user = User.save(*params) if user: log_token = aut.create_and_save_log_token(user) self.set_cookies({ 'username': user.username, 'log_token': log_token }) self.redirect("/") else: _, errors = valid(*params) self.render("signup.html", {'errors': errors})