When an app (page) initializes, Keratin looks for an existing token and kicks off its maintenance strategy. This was happening behind the scenes, with no way for the host app to know if and when a session had been found.
Further, the existing token might have expired. Keratin would attempt to refresh it, but would meanwhile expose the expired token to the host app.
This changeset fixes both. The setFooStore methods will now return a promise that is fulfilled when a session is found and viable. This is an asynchronous process because it might require first refreshing the token from the AuthN server.
When an app (page) initializes, Keratin looks for an existing token and kicks off its maintenance strategy. This was happening behind the scenes, with no way for the host app to know if and when a session had been found.
Further, the existing token might have expired. Keratin would attempt to refresh it, but would meanwhile expose the expired token to the host app.
This changeset fixes both. The
setFooStore
methods will now return a promise that is fulfilled when a session is found and viable. This is an asynchronous process because it might require first refreshing the token from the AuthN server.fixes #13