Project-Nexus
Project-Nexus copied to clipboard
Page redirection problems
Describe the bug When users have created a new post, they remain stuck on the write page while the post is created. Similar behavior is observed in a few other instances, such as the deletion of a post wherein the user remains on the post's page after clicking the delete button, redirection to the homepage URL after logging in, and registering a new account.
To Reproduce Steps to reproduce the behavior:
- Create a new account
- The homepage is displayed, but the URL is that of the register page
- Login using an account
- The same issue is observed as with the register issue
- Go to 'write' page
- Fill in the data for relevant fields
- Click on
Publish - There is no redirection to the post's page
- Verify post creation by going to the homepage
- Click on the post
- Click on the
deletebutton - There is no redirection back to the homepage
Expected behavior
- The user should be redirected to the
homepageafter logging in or registering a new account. - The user should be redirected to the
postpage after creating the post. - The user should be redirected to the
homepageafter deleting a post.
Seems to work fine for me. On local and live.
While it does render the appropriate page thanks to the new update, the url doesn't seem to change in some cases. Could you try and test if it loads the home url when we login?
Thanks
I don't really understand the working of login in the code. On login submit, we send the data to Axios, and on validation, we dispatch a LOGIN_SUCCESS event. Where does that logic reside? It changes the appearance of the login page to the homepage but with no posts and the URL doesn't change. If using a window replace location after login then it looks as if it logs in, the login form disappears, the empty home page appears without any posts and login URL, and then it reloads to the homepage with posts, this time with the correct URL.