realworld icon indicating copy to clipboard operation
realworld copied to clipboard

Redirect to article page rather than home after clicking "Sign in or sign up to add comments on this article"

Open cirosantilli opened this issue 4 years ago • 2 comments

🚀 feature request

Relevant scope

What is the scope of this request?

  • [X] Frontend specs
  • [ ] Backend specs
  • [ ] Other... Please describe:

Description

A clear and concise description of the problem or missing capability...

Visit an article signed out. It shows "Sign in or sign up to add comments on this article.". Click sign in and sign in. It redirects you to home / instead of the article. Tested on https://demo.realworld.io and https://react-redux.realworld.io/

Describe the solution you'd like

If you have a solution in mind, please describe it.

Redirect to the article you were in, not home.

Describe alternatives you've considered

Have you considered any alternative solutions or workarounds?

cirosantilli avatar Jun 27 '21 17:06 cirosantilli

That's great that you mention that.

How about in the future spec the login and register are not any distinct routes anymore, but buttons which opens modals? To have modals in the spec, to show of how portaling works is I think a good idea anyway.

Why I dislike having auth as routes:

  • these routes are only valid depending on your current auth-state
  • these are not really sharable url's
  • they pollute the browser history, the back-button will lead you to a page which isn't valid/relevant anymore

Why I think modals for login/register are superior:

  • the user stays on the same page, no weird remembering where the user came from is necessary
  • browser-history only has valid and relevant pages in it
  • showing of how to implement portals in any given tech

plusgut avatar Jul 05 '21 11:07 plusgut

Yes, that would not be a bad option I think. Notably for me my general concern is to make the logged out website viewable without JavaScript, so no problem with the login URL being a JS-only button. I guess someone would just need to sit down and make a reference POC if there's strong support for it.

cirosantilli avatar Jul 05 '21 11:07 cirosantilli