Пример #1
0
 def do_login(self, username, password):
     password = Sha256Hash(password, SALT_KEY, 2048).toBase64()
     print password
     user = _subject()
     session = user.getSession()
     if not user.isAuthenticated():
         token = UsernamePasswordToken(username, password)
         token.setRememberMe(True)
         try:
             user.login(token)
         except IncorrectCredentialsException, e:
             return False
Пример #2
0
 def get(self):
     _subject().logout()
     return redirect(url_for("index"))
Пример #3
0
 def get(self):
     user = _subject()
     return render_template("login.html", currentUser=user)