Skip to content

Commit

Permalink
Merge pull request #291 from eve-bright/fix-rest-passowrd-change-bug
Browse files Browse the repository at this point in the history
Check current saved credentials before checking for auth disabled
  • Loading branch information
pe4cey authored Oct 18, 2016
2 parents 6942ce3 + 17e7eb5 commit ed60619
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
2 changes: 1 addition & 1 deletion app/scripts/controllers/Auth.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,6 @@ angular.module('neo4jApp.controllers')
)

setPolicyMessage()
connectIfNoAuthorizationRequired()
connectIfNoAuthorizationRequired() unless ConnectionStatusService.isConnected()
$scope.clusterRole = $rootScope.neo4j.clusterRole
]
35 changes: 20 additions & 15 deletions app/scripts/services/Auth.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,31 @@ angular.module('neo4jApp.services')
hasValidAuthorization: (retainConnection = no) ->
that = @
q = $q.defer()
req = @authorizationRequired()
req.then(
(r) ->
ConnectionStatusService.setConnected yes
q.resolve r
,
(r) ->
if ConnectionStatusService.connectionAuthData().length > 0
that.isConnected(retainConnection).then(
if ConnectionStatusService.connectionAuthData().length > 0
that.isConnected(retainConnection).then(
(r) ->
ConnectionStatusService.setAuthorizationRequired no
q.resolve r
,
(r) ->
that.authorizationRequired().then(
(r) ->
ConnectionStatusService.setConnected yes
q.resolve r
,
(r) ->
, (r) ->
ConnectionStatusService.setConnected no
q.reject r
)
else
ConnectionStatusService.setConnected no
q.reject r
)
)
else
that.authorizationRequired().then(
(r) ->
ConnectionStatusService.setConnected yes
q.resolve r
, (r) ->
ConnectionStatusService.setConnected no
q.reject r
)
q.promise

isConnected: (retainConnection = no) ->
Expand Down

0 comments on commit ed60619

Please sign in to comment.