summaryrefslogtreecommitdiffstats
path: root/extensions/Ember/lib
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/Ember/lib')
-rw-r--r--extensions/Ember/lib/WebService.pm6
1 files changed, 6 insertions, 0 deletions
diff --git a/extensions/Ember/lib/WebService.pm b/extensions/Ember/lib/WebService.pm
index bb4e5f8ad..4f7a0c713 100644
--- a/extensions/Ember/lib/WebService.pm
+++ b/extensions/Ember/lib/WebService.pm
@@ -114,6 +114,12 @@ sub show {
Bugzilla->switch_to_shadow_db();
+ # Throw error if token was provided and user is not logged
+ # in meaning token was invalid/expired.
+ if (exists $params->{token} && !Bugzilla->user->id) {
+ ThrowUserError('invalid_token');
+ }
+
my $bug_id = delete $params->{id};
$bug_id || ThrowCodeError('params_required',
{ function => 'Ember.show', params => ['id'] });