Commit 77a63fa1 authored by gergely-ujvari's avatar gergely-ujvari

Bugfix: Check authorization before showEditor

parent 2567071c
......@@ -312,7 +312,12 @@ class Hypothesis extends Annotator
showEditor: (annotation) =>
@element.injector().invoke [
'$location', '$rootScope', '$route'
($location, $rootScope, $route) ->
($location, $rootScope, $route) =>
unless this.plugins.Auth? and this.plugins.Auth.haveValidToken()
$route.current.locals.$scope.$apply ->
$route.current.locals.$scope.$emit 'showAuth', true
return
# Set the path
search =
id: annotation.id
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment