Closed KonnorRogers closed 2 years ago
Still haven't come up with a good way of solving this. Perhaps this should be on the end user to figure this out, I have a couple ideas in mind, but nothing solid.
@ParamagicDev do you suggest any workaround? Trying to create a link to Devise's sign out here.
@manuelreis Theres 2 possible solutions:
A.) listen for ajax:success
, check event.detail.status == 204
and then issue a window.location.reload() to force a manual reload. (Not Recommended)
B.) The other option is to override the default devise behavior and send back a redirect to an actual location.
I believe this should work for ya.
https://gist.github.com/ParamagicDev/8f93a71d3498265cb84ce2d665b9955a
Expected Behavior
204 no contents should request the current page
Actual Behaviour
204s do nothing.
Proposed Fix
Use morphdom to request the current page and then morph the response