示例#1
0
 def postlogout(self):
     """
     The user is redirected to this action on logout.  It simply displays
     a page informing them that they have logged in, giving them the
     option to return to their previous page or log back in.
     """
     came_from = request.params.get("came_from")
     c.came_from = came_from
     return render("/auth/goodbye.html")
示例#2
0
 def challenge(self):
     """
     This action will display a login form to the user.  It checks the value
     of login_counter to determine if an attempt was already made to log in
     and displays an error message if there was.
     """
     c.error = ""
     c.login_counter = request.environ.get("repoze.who.logins")
     c.came_from = request.params.get("came_from") or url("/")
     if c.login_counter > 0:
         c.error = "Invalid username or password."
     return render("/auth/challenge.html")