Skip to content

[8.x] Set intended URL before email verification #34808

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

sebdesign
Copy link
Contributor

This brings the same behavior to the verified middleware as the auth and password.confirm middleware. When a user is trying to access a protected route before they have verified their email, they are redirected to the verification.notice route. Then, when they click the email verification link, they are redirected to the home page, instead of the protected page they intended to access.

Example with laravel/fortify:

  1. User goes to /user/profile.
  2. If they haven't verified their email, they are redirected to /email/verify.
  3. User checks their email, and click on /email/verify/{id}/{hash}.
  4. After the verification, they are redirected to /home or the home page set in config/fortify.php.

The same also applies to laravel/ui.

With this PR, the intended URL will be /user/profile, so with some modifications on the Fortify (I'll submit a PR), we can redirect users to the intended page instead.

P.S.: Can I submit PR to laravel/ui as well?

taylorotwell pushed a commit to laravel/fortify that referenced this pull request Oct 12, 2020
This allows users to redirect to the intended URL instead of the home page, after they have verified their email address, as described in laravel/framework#34808
@taylorotwell taylorotwell merged commit 422b848 into laravel:8.x Oct 12, 2020
@GrahamCampbell GrahamCampbell changed the title Set intended URL before email verification [8.x] Set intended URL before email verification Oct 13, 2020
GrahamCampbell added a commit that referenced this pull request Oct 13, 2020
taylorotwell added a commit that referenced this pull request Oct 13, 2020
* Revert "Set intended URL before email verification (#34808)"

This reverts commit 422b848.

* Update EnsureEmailIsVerified.php

* Update EnsureEmailIsVerified.php

Co-authored-by: Taylor Otwell <[email protected]>
growno1127 added a commit to growno1127/fortify that referenced this pull request Mar 15, 2024
This allows users to redirect to the intended URL instead of the home page, after they have verified their email address, as described in laravel/framework#34808
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants