Improve frontend login redirections

Created on 5 November 2024, 18 days ago

Problem

When the frontend login is used, the system redirects to the user account page on the backend. This is weird from a UX perspective, we should stick in the frontend.

Steps to reproduce

Test the demo.

Proposed resolution

- One possible solution would be to add the user account page as frontend route. But that would also trigger the redirection to the frontend when viewed from the backend, what is not what we want.
- It would be better to make the user account route viewable from backend and frontend. It is, but atm the redirect is absolute and thus points to the backend.
Options:
A) We could use some alter logic the lupus_decoupled_user_forms module to prevent that and make the redirect relative.
B) We could change URL generation to make absolute URLs point to the frontend WHEN we are currently rendering a ce-api request. This is probably not wanted for every URL, there needs to be a way to generate backend URLs still. Thus, instead of doing it always, we could introduce a new option / category for URLs for that. Sort of "neutral" URLs, that stay in backend/frontend as needed.

📌 Task
Status

Active

Version

1.0

Component

Code

Created by

🇦🇹Austria fago Vienna

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @fago
  • Merge request !107add keep frontend paths option and test → (Merged) created by fago
  • 🇦🇹Austria fago Vienna

    I figured it's best to create a new setting for that and implemented this.
    I also improved in-code comments for the existing options, such that there is a better overview of what they actually do. During implementing I realized we need to keep paths, not routes. Since in the path processor, the route name is not available.

    The MR adds /user to and the user account page to the "keep frontend" paths, that way a user login in the frontend keeps you in the frontend.

  • 🇦🇹Austria fago Vienna

    unfortunately the gitpod link does not work for lupus-decoupled branches still, see https://www.drupal.org/project/lupus_decoupled/issues/3347260#comment-15... 🐛 Gitpod branch checkouts always use 1.x-dev Active

    anyway, I checked the code out manually there and tested it at the gitpod environment also. works as it should!

  • Pipeline finished with Skipped
    10 days ago
    #337005
    • fago committed 93eb8dc4 on 1.x
      Issue #3485563: Improve frontend login redirections
      
  • 🇦🇹Austria fago Vienna

    re-checking on the solution, I think this is the right way and solves the issue. thus, moving on - merged!

Production build 0.71.5 2024