Commit 393fc0d4 authored by Randall Leeds's avatar Randall Leeds

Correct userids handling in session auth idp

parent 3c1764df
...@@ -14,7 +14,9 @@ configure = [ ...@@ -14,7 +14,9 @@ configure = [
identityProvider.checkAuthorization = [ identityProvider.checkAuthorization = [
'session', 'session',
(session) -> (session) ->
session.load().$promise session.load().$promise.then (data) ->
certificate: data.csrf
userid: data.userid
] ]
identityProvider.forgetAuthorization = [ identityProvider.forgetAuthorization = [
...@@ -27,7 +29,12 @@ configure = [ ...@@ -27,7 +29,12 @@ configure = [
'$q', '$rootScope', '$q', '$rootScope',
($q, $rootScope) -> ($q, $rootScope) ->
deferred = $q.defer() deferred = $q.defer()
$rootScope.$on 'session', (event, data) -> deferred.resolve data
$rootScope.$on 'session', (event, data) ->
deferred.resolve
certificate: data.csrf
userid: data.userid
deferred.promise deferred.promise
] ]
] ]
......
...@@ -62,6 +62,7 @@ identityProvider = -> ...@@ -62,6 +62,7 @@ identityProvider = ->
invokeCallbacks = (grant={}) -> invokeCallbacks = (grant={}) ->
{userid, certificate} = grant {userid, certificate} = grant
userid or= null
# Fire callbacks as appropriate. # Fire callbacks as appropriate.
# Consult the state matrix in the `navigator.id.watch` documentation. # Consult the state matrix in the `navigator.id.watch` documentation.
# https://developer.mozilla.org/en-US/docs/Web/API/navigator.id.watch # https://developer.mozilla.org/en-US/docs/Web/API/navigator.id.watch
......
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