Modify ↓
Opened 18 years ago
Closed 15 years ago
#474 closed defect (wontfix)
Nonexistent login pages always fail
Reported by: | Owned by: | Noah Kantrowitz | |
---|---|---|---|
Priority: | normal | Component: | AuthFormPlugin |
Severity: | normal | Keywords: | patch |
Cc: | Trac Release: | 0.9 |
Description
If the login_path (specified in [authform] in trac.ini using the patch from #125) path does not exist, authform will get a 404 error trying to retrieve that page on successful login. This causes urllib2.urlopen() (and therefore _try_http_auth) to throw an exception, making authform think that authentication failed. So, if /login does not exist on a site, and the user authenticated successfully, a 404 error will cause the login page to say that the login failed anyway.
The attached patch catches a urllib2.HTTPError instead of an IOError, and detects for and accepts a 404 error if it occurs. Otherwise, it indicates a failed login like normal.
Attachments (1)
Note: See
TracTickets for help on using
tickets.
Patch to allow for 404 errors when attempting authentication.