Store original location to return to after signin#360
Conversation
|
I think the redirect to the 'edit profile' page is a leftover of the old CfP logic, trying to ensure speakers edit their profile before submitting a talk. Providing a linear flow through the submission (register, profile, submit talk). We probably shouldn't redirect if there is already a profile from previous submissions. But why did the 'return' break the tests? I thought it has to return the goto url instead of 'root_url'? |
|
Looks like there's an integration test that checks for users being redirected to the cfp page after they sign up. I forgot the return in my final commit, so the return seems to break the test. This means after I figured out where the user should finally be redirected to, I should update the test to reflect the change. |
|
I think the cfp user should still be redirected to the profile page for the first time after sign up. |
|
Currently, they are also constantly nagged to enter their availabilities, even when the view doesn't exactly indicate, how. I saw that you can redirect after sign-up, but what we actually need the direct after the confirm, right? |
|
Yes, since we use |
|
The button is there in the cfp/person view, but the flash is also shown when I then edit an event: e.g. |
|
Found out, why the flash stays there: If you want to alert on the current view and not in the redirect, you need to set the flash.now variable, not the flash. So in app/controllers/cfp/people_controller.rb it must read
Will look for more instances and then commit. |
|
|
||
| def after_sign_in_path_for(resource) | ||
| goto = stored_location_for(resource) | ||
| return goto if not goto.blank? |
|
Excuse me, @erdgeist, why don't you squash commits for PR? IMHO, it's easier to find and revert changes, when 1 PR = 1 commit. |
Since the welcome controller is not very useful once you're logged in, it now redirects to the appropriate page: * the edit profile page, if public_name still is user.email * the cfp user page that shows your events and allows adding or joining new events, if your proifle has been filled * the conference management page for crew The sign_in now redirects back to the ressource that triggered the sign in request or to the cfp root path which then redirects further as outlined above. The tests have been modified accordingly and now work.
|
@artemasmith Isn't squashing done when finally merging to master? I'm not familiar with best practises here but having work-in-progress commits visible until the feature is finished looks like a good idea. |
|
@erdgeist I'm sorry, I didn't mention that it's still in progress. Yep, you're right, commits are squashed before PR merge. |
8092e12 to
801a9f0
Compare
Get up to date with upstream
…t person page from there, too
… subtle clue that they might to look elsewhere
…gned in successfully message
|
Reviving the PR, as at the last conference there's been users complaining again about invite token URLs not working. @eladeyal-intel can you please point me to where you managed to get the automated translations? I would want to provide them for the new flash message. |
|
i18n-tasks translate-missing -f en -l de,es,fr,it,pt-BR,ru,zh |
|
@eladeyal-intel I see, this requires a paid account. Thanks. |
|
@erdgeist - Maybe you can push |
Looks like devise has had a mechanism to return to the originally requested resource after sign in, as described here:
https://github.com/plataformatec/devise/wiki/How-To:-Redirect-back-to-current-page-after-sign-in,-sign-out,-sign-up,-update
So for root and the direct cfp sign in urls this patch sticks to the old logic of redirecting users to their edit profile page (why is that, btw) and for all other cases return to the original resource (as would come in handy with join-token uris).