Link is lost when user logs in#6300
Conversation
|
Beware @gemmatm there are a lot of commits that do not correspond to the PR itself |
…p_previous_link_when_user_logs_in
e6833cd to
0a6ae20
Compare
…p_previous_link_when_user_logs_in
2b40b82 to
ef8e34a
Compare
…p_previous_link_when_user_logs_in
857a3a4 to
ba88c6e
Compare
ba88c6e to
4c80a4b
Compare
|
Shouldn't this be implemented with the You should be able to just call It's already called by Decidim but I guess it's not working in this case because the redirection happens before the location is stored. |
You are right, this makes it much easier! Thank you very much! |
| # Next stop: Let's check whether auth is ok | ||
| unless user_signed_in? | ||
| flash[:warning] = t("actions.login_before_access", scope: "decidim.core") | ||
| store_location_for(:user, request.path) |
There was a problem hiding this comment.
I think you could just call store_current_location here, right?
There was a problem hiding this comment.
It gives errors on some controllers while running tests if I do so
3bbd983 to
b97c765
Compare
* Change redirection after login * Do not redirect if first login * Refactor and remove before_action call * Add test * Refactor all code into devise method store_location_for * Replace store_location_for with store_current_location * Revert latest changes Co-authored-by: Víctor <victor.ol@coditramuntana.com>
🎩 What? Why?
When a member recives a link, and does not have the session opened, the link takes him directly to the login screen. When the user is already logged, the user loses the link to which is supposed to go and redirects to the homepage, instead of going to the initial link.
📌 Related Issues
📋 Subtasks
CHANGELOGupgrade notes, if required📷 Screenshots (optional)