From 99589d82d943bedcd9a8ade3d91f84d770fcd5c5 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Thu, 29 Aug 2013 17:25:24 -0400 Subject: Bug 909634 - backport upstream bug 893195 to bmo/4.2 for token auth support in webservices --- Bugzilla/Auth.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'Bugzilla/Auth.pm') 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 if users can change their own email address, C otherwise. +=item C + +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 and C. + =back =head1 STRUCTURE -- cgit v1.2.3-24-g4f1b