#378 Don't redirect to the Continue endpoint on auth failure
Merged 7 months ago by abompard. Opened 7 months ago by abompard.
abompard/ipsilon auth-failure-continue  into  master

file modified
+9 -1
@@ -197,7 +197,12 @@ 

              session.logout(None)

              raise cherrypy.HTTPError(401, message)

  

-         raise cherrypy.HTTPRedirect(transdata['login_return'])

+         # Redirect to the login page

+         raise cherrypy.HTTPRedirect(

+             "%s/login?%s" % (

+                 cherrypy.config.get('base.mount', ""),

+                 trans.get_GET_arg())

+         )

  

      def set_auth_error(self):

          cherrypy.response.status = 401
@@ -286,10 +291,12 @@ 

          username = cookie.value

  

          target = None

+         error = None

          if self.trans is not None:

              tid = self.trans.transaction_id

              target = self.trans.retrieve().get('login_target')

              username = self.trans.retrieve().get('login_username')

+             error = self.trans.retrieve().get('message')

          if tid is None:

              tid = ''

  
@@ -306,6 +313,7 @@ 

              "other_stacks": other_stacks,

              "username": username,

              "login_target": target,

+             "error": error,

              "cancel_url": '%s/login/cancel?%s' % (self.basepath,

                                                    self.trans.get_GET_arg()),

          }

This should prevent the "User not authenticated at continue" error.

Fixes: #361

Pull-Request has been merged by abompard

7 months ago
Metadata