You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.
This was found by a customer and repro'ed by me. This is a hard-to-discover hang that happens in a CORS scenario when STORMPATH_CONFIG.ENDPOINT_PREFIX is not configured.
Because STORMPATH_CONFIG.ENDPOINT_PREFIX isn't pointing to the remote server, the call to /me in UserService.prototype.get is requesting localhost:3000/me, which succeeds and returns index.html
self.currentUser = new User(response.data.account || response.data) doesn't fail but stuffs index.html into currentUser
When a state change to /login is detected, this block causes an infinite loop because $user.currentUser.href never exists:
This doesn't totally solve the problem, though, because finally is ignoring whether the request succeeds or fails.
Configuring STORMPATH_CONFIG.ENDPOINT_PREFIXfixes the problem, but I'm reporting this because I think the failure mode could be better in this case - hanging is hard to diagnose.
The text was updated successfully, but these errors were encountered:
This was found by a customer and repro'ed by me. This is a hard-to-discover hang that happens in a CORS scenario when
STORMPATH_CONFIG.ENDPOINT_PREFIX
is not configured.Repro branch: https://github.com/nbarbettini/StormpathAuth/tree/hang-repro/Client
This should get the sample client running, no server required:
What's happening is this:
STORMPATH_CONFIG.ENDPOINT_PREFIX
isn't pointing to the remote server, the call to/me
inUserService.prototype.get
is requestinglocalhost:3000/me
, which succeeds and returns index.htmlself.currentUser = new User(response.data.account || response.data)
doesn't fail but stuffs index.html intocurrentUser
/login
is detected, this block causes an infinite loop because$user.currentUser.href
never exists:This could partially be solved by doing a sanity check in
UserService.prototype.get
:This doesn't totally solve the problem, though, because
finally
is ignoring whether the request succeeds or fails.Configuring
STORMPATH_CONFIG.ENDPOINT_PREFIX
fixes the problem, but I'm reporting this because I think the failure mode could be better in this case - hanging is hard to diagnose.The text was updated successfully, but these errors were encountered: