-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Authentication completed but redirect not happening.. #6
Comments
@ajeetvarma which function doesn't behave as you expect? Also, if you could show me the part of the code that fails will be very helpful |
My package.json like this..
My Routes configuration like this..
api.js is like this..
SessionAction.js like this..
Login.js is like this ..
My Input.js is also just like your package file .. After authentication is completed when i check the inspect element redux options i found token and another results are coming in session storage and also authenticated and checked are displaing as true but it is seeming that the code
is not working. Also when i am refreshing the same page after authentication the session storage values are deleted automatically i. e. it become logout automatically .. Thanks a lot for your response and hopes for help from you .. |
@ajeetvarma did you try to put a brake point before the redirect line? Just like this: sessionService.saveSession(response.token)
.then(() => {
sessionService.saveUser(response.data)
.then(() => {
debugger; // -------> add this line
browserHistory.replace('/profile');
});
}); Then try to login with the inspector open and check if the code stops there. If the code stops there it means that the problem surely is in the In the case that it doesn't stops there you can try to add a sessionService.saveUser(response.data)
.then(() => {
browserHistory.replace('/profile');
}).catch((err) => console.log(err)); If you use the Let me know if it works, I hope to be helpful |
@bernabe9 , Thanks a lot for your suggestion . I have resolve my problem after making few changes in my code. I used localStorage instead of sessionService. My code was like following line..
And this code working very fine.
Again very much thanks a lot to you .. |
I have used this and authentication is happening very fine but after being authenticated page is not being redirected on required route .
I have strictly followed your documentation but i do't know what wrong i m doing .
Please suggest me if any more step has to be taken..
Thanks in advance ..
The text was updated successfully, but these errors were encountered: