diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2013-08-29 23:25:24 +0200 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2013-08-29 23:25:24 +0200 |
commit | 99589d82d943bedcd9a8ade3d91f84d770fcd5c5 (patch) | |
tree | 25d4f8baedfe28e592a7226b4276523423132963 /Bugzilla/Auth.pm | |
parent | bbf877a6b1500f59988245954f40cee5ebec0a85 (diff) | |
download | bugzilla-99589d82d943bedcd9a8ade3d91f84d770fcd5c5.tar.gz bugzilla-99589d82d943bedcd9a8ade3d91f84d770fcd5c5.tar.xz |
Bug 909634 - backport upstream bug 893195 to bmo/4.2 for token auth support in webservices
Diffstat (limited to 'Bugzilla/Auth.pm')
-rw-r--r-- | Bugzilla/Auth.pm | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Bugzilla/Auth.pm b/Bugzilla/Auth.pm index 7775a03c9..2c58b52a8 100644 --- a/Bugzilla/Auth.pm +++ b/Bugzilla/Auth.pm @@ -124,6 +124,15 @@ sub can_logout { return $getter->can_logout; } +sub login_token { + my ($self) = @_; + my $getter = $self->{_info_getter}->{successful}; + if ($getter && $getter->isa('Bugzilla::Auth::Login::Cookie')) { + return $getter->login_token; + } + return undef; +} + sub user_can_create_account { my ($self) = @_; my $verifier = $self->{_verifier}->{successful}; @@ -426,6 +435,14 @@ Params: None Returns: C<true> if users can change their own email address, C<false> otherwise. +=item C<login_token> + +Description: If a login token was used instead of a cookie then this + will return the current login token data such as user id + and the token itself. +Params: None +Returns: A hash containing C<login_token> and C<user_id>. + =back =head1 STRUCTURE |