diff options
author | David Lawrence <dkl@mozilla.com> | 2017-06-01 01:09:52 +0200 |
---|---|---|
committer | David Lawrence <dkl@mozilla.com> | 2017-06-01 01:09:52 +0200 |
commit | 3a8db63716e1846323f4138c1628ef1a17eabb42 (patch) | |
tree | 1a7b698c15f00760dba6e3e8ed0d70337684828b /extensions/PhabBugz/Extension.pm | |
parent | 77658b1060a8761c15dfbedefce52eb1721aacc3 (diff) | |
download | bugzilla-3a8db63716e1846323f4138c1628ef1a17eabb42.tar.gz bugzilla-3a8db63716e1846323f4138c1628ef1a17eabb42.tar.xz |
Bug 1368066 - When using bmo auth delegation from Phabricator, the confirmation should be skipped similar to mozreview
Diffstat (limited to 'extensions/PhabBugz/Extension.pm')
-rw-r--r-- | extensions/PhabBugz/Extension.pm | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/extensions/PhabBugz/Extension.pm b/extensions/PhabBugz/Extension.pm index 501fbc65d..1ba1609f5 100644 --- a/extensions/PhabBugz/Extension.pm +++ b/extensions/PhabBugz/Extension.pm @@ -20,4 +20,17 @@ sub config_add_panels { $modules->{PhabBugz} = "Bugzilla::Extension::PhabBugz::Config"; } +sub auth_delegation_confirm { + my ($self, $args) = @_; + my $phab_callback_url = Bugzilla->params->{phabricator_auth_callback_url}; + my $phab_app_id = Bugzilla->params->{phabricator_app_id}; + + return unless $phab_callback_url; + return unless $phab_app_id; + + if (index($args->{callback}, $phab_callback_url) == 0 && $args->{app_id} eq $phab_app_id) { + ${$args->{skip_confirmation}} = 1; + } +} + __PACKAGE__->NAME; |