This prevents a 404 error which can cause an "Authentication Required"
popup to appear in Chrome.
Signed-off-by: Jeff Davis <jdavis@sitka.bclibraries.ca>
#
apiLibraryInfo: ->
- get = -> od.api session.links.libraries.href
+ get = ->
+ if session.token.token_type?
+ od.api session.links.libraries.href
+ else
+ # We have no token of either kind. Let's default to getting
+ # a library access token.
+ od.apiDiscAccess()
+ .then get, logError
+ .then ok
ok = (x) ->
session.links.update x