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
I have a rails back end (using devise_token_auth) that is responding to a Create action with a redirect_to the resulting resource. This gives a 302 response to the /resources POST which results in the browser redirecting to the correct /resource/NN GET to access the created resource. I can't remember exactly why I did it like that.
This causes problems for ng-token_auth. The/resources 302 response has a new token in it. The /resource/NN request however uses the same token as the /resources request. I can't see why it does this as it should have the new token as it can't redirect until it has seen the /resources response. This /resource/NN request gets through as it will be within the default batch timing for devise_token_auth. Any subsequent request done after the batch timeout will continue to use the original /resources request token and so fail. I initially thought it might be a devise_token_auth issue but it is looking more and more like it is ng related.
For now I have changed the rails response to respond_with and everything is fine. Any thoughts on why a 302 and redirect has this behaviour would be welcome.
The text was updated successfully, but these errors were encountered:
I have a rails back end (using devise_token_auth) that is responding to a Create action with a redirect_to the resulting resource. This gives a 302 response to the
/resources POST
which results in the browser redirecting to the correct/resource/NN GET
to access the created resource. I can't remember exactly why I did it like that.This causes problems for ng-token_auth. The
/resources
302 response has a new token in it. The/resource/NN
request however uses the same token as the/resources
request. I can't see why it does this as it should have the new token as it can't redirect until it has seen the/resources
response. This/resource/NN
request gets through as it will be within the default batch timing for devise_token_auth. Any subsequent request done after the batch timeout will continue to use the original/resources
request token and so fail. I initially thought it might be a devise_token_auth issue but it is looking more and more like it is ng related.For now I have changed the rails response to respond_with and everything is fine. Any thoughts on why a 302 and redirect has this behaviour would be welcome.
The text was updated successfully, but these errors were encountered: