Project-Nexus icon indicating copy to clipboard operation
Project-Nexus copied to clipboard

Page redirection problems

Open vinsdragonis opened this issue 3 years ago • 3 comments

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:

  1. Create a new account
  2. The homepage is displayed, but the URL is that of the register page
  3. Login using an account
  4. The same issue is observed as with the register issue
  5. Go to 'write' page
  6. Fill in the data for relevant fields
  7. Click on Publish
  8. There is no redirection to the post's page
  9. Verify post creation by going to the homepage
  10. Click on the post
  11. Click on the delete button
  12. There is no redirection back to the homepage

Expected behavior

  • The user should be redirected to the homepage after logging in or registering a new account.
  • The user should be redirected to the post page after creating the post.
  • The user should be redirected to the homepage after deleting a post.

vinsdragonis avatar Aug 31 '22 07:08 vinsdragonis

Seems to work fine for me. On local and live.

vikashjajra avatar Sep 09 '22 04:09 vikashjajra

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

vinsdragonis avatar Sep 09 '22 04:09 vinsdragonis

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.

vikashjajra avatar Sep 09 '22 06:09 vikashjajra