Пример #1
0
 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")
Пример #2
0
 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")
Пример #3
0
    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")
Пример #4
0
 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})
Пример #5
0
    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})
Пример #6
0
    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")
Пример #7
0
    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})