Ignore:
Timestamp:
10 May 2025, 20:30:32 (6 hours ago)
Author:
Henrik Bettermann
Message:

Logout again if captcha result was wrong.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pages.py

    r18073 r18074  
    374374        self.password_default = password
    375375        if SUBMIT is not None:
    376             if not self.captcha_result.is_valid:
    377                 # Captcha will display error messages automatically.
    378                 # No need to flash something.
    379                 return
    380             if self.request.principal.id != 'zope.anybody':
     376            if self.request.principal.id == 'zope.anybody':
     377                if not self.captcha_result.is_valid:
     378                    # Captcha will display error messages automatically.
     379                    # No need to flash something.
     380                    return
     381            else:
     382                if not self.captcha_result.is_valid:
     383                    # Captcha will display error messages automatically.
     384                    # No need to flash something.
     385                    auth = getUtility(IAuthentication)
     386                    ILogout(auth).logout(self.request)
     387                    self.redirect(self.application_url() + '/login')
     388                    return
    381389                #self.flash(_('You logged in.'))
    382390                if self.request.principal.user_type == 'student':
Note: See TracChangeset for help on using the changeset viewer.