예제 #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)