Skip to content

Commit

Permalink
Merge pull request #205 from eve-bright/allow-reconnect-when-auth-is-…
Browse files Browse the repository at this point in the history
…not-required

Allow reconnect when auth is not required
  • Loading branch information
pe4cey authored Sep 14, 2016
2 parents 327dc61 + 2331ce5 commit bdceaff
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/scripts/controllers/Auth.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ angular.module('neo4jApp.controllers')
$scope.policy_message = ''
$scope.CurrentUser = CurrentUser

connectIfNoAuthorizationRequired = ->
AuthService.authorizationRequired().then(->
$scope.static_user = ConnectionStatusService.connectedAsUser()
$scope.static_is_authenticated = ConnectionStatusService.isConnected()
)

setPolicyMessage = ->
return unless $scope.static_is_authenticated
_connection_summary = ConnectionStatusService.getConnectionStatusSummary()
Expand Down Expand Up @@ -97,4 +103,6 @@ angular.module('neo4jApp.controllers')
)

setPolicyMessage()
connectIfNoAuthorizationRequired()

]
1 change: 1 addition & 0 deletions app/scripts/services/Auth.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ angular.module('neo4jApp.services')
##Success, no auth required
clearConnectionAuthData()
ConnectionStatusService.setAuthorizationRequired no
ConnectionStatusService.setConnected yes
q.resolve r
,
(r) ->
Expand Down

0 comments on commit bdceaff

Please sign in to comment.