summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Auth
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-09-27 18:07:51 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-09-27 18:07:51 +0200
commit0048909dbe4141af69eaf930562c3e8f653dbe0d (patch)
tree3e24f8d9db7e83846db69d66c64d1261186270ad /Bugzilla/Auth
parent0228e2ab199a9b2b0287f3aa02a0f607e22e4054 (diff)
downloadbugzilla-0048909dbe4141af69eaf930562c3e8f653dbe0d.tar.gz
bugzilla-0048909dbe4141af69eaf930562c3e8f653dbe0d.tar.xz
Revert Bug 917669 - invalid or expired authentication tokens and cookies should throw errors, not be silently ignored
Diffstat (limited to 'Bugzilla/Auth')
-rw-r--r--Bugzilla/Auth/Login/Cookie.pm21
1 files changed, 8 insertions, 13 deletions
diff --git a/Bugzilla/Auth/Login/Cookie.pm b/Bugzilla/Auth/Login/Cookie.pm
index 4f4ef80ab..88c48e236 100644
--- a/Bugzilla/Auth/Login/Cookie.pm
+++ b/Bugzilla/Auth/Login/Cookie.pm
@@ -21,7 +21,6 @@ use base qw(Bugzilla::Auth::Login);
use Bugzilla::Constants;
use Bugzilla::Util;
-use Bugzilla::Error;
use List::Util qw(first);
@@ -81,9 +80,7 @@ sub get_login_info {
AND (ipaddr = ? OR ipaddr IS NULL)',
undef, ($login_cookie, $user_id, $ip_addr));
- # If the cookie or token is valid, return a valid username.
- # If they were not valid and we are using a webservice, then
- # throw an error notifying the client.
+ # If the cookie is valid, return a valid username.
if ($is_valid) {
# If we logged in successfully, then update the lastused
# time on the login cookie
@@ -91,16 +88,12 @@ sub get_login_info {
WHERE cookie = ?", undef, $login_cookie);
return { user_id => $user_id };
}
- elsif (i_am_webservice()) {
- ThrowUserError('invalid_cookies_or_token');
- }
}
- # Either the cookie or token is invalid and we are not authenticating
- # via a webservice, or we did not receive a cookie or token. We don't
- # want to ever return AUTH_LOGINFAILED, because we don't want Bugzilla to
- # actually throw an error when it gets a bad cookie or token. It should just
- # look like there was no cookie or token to begin with.
+ # Either the he cookie is invalid, or we got no cookie. We don't want
+ # to ever return AUTH_LOGINFAILED, because we don't want Bugzilla to
+ # actually throw an error when it gets a bad cookie. It should just
+ # look like there was no cookie to begin with.
return { failure => AUTH_NODATA };
}
@@ -111,7 +104,9 @@ sub login_token {
return $self->{'_login_token'} if exists $self->{'_login_token'};
- if (!i_am_webservice()) {
+ if ($usage_mode ne USAGE_MODE_XMLRPC
+ && $usage_mode ne USAGE_MODE_JSON
+ && $usage_mode ne USAGE_MODE_REST) {
return $self->{'_login_token'} = undef;
}