Skip to content
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

[1.x] Naming 2FA routes for consistency #269

Merged
merged 2 commits into from
May 21, 2021
Merged

[1.x] Naming 2FA routes for consistency #269

merged 2 commits into from
May 21, 2021

Conversation

schonhoff
Copy link
Contributor

After I included Fortify in an old Laravel project (with laravel ui), I was forced myself to use the url() helper instead the route() helper because some routes had no names on it. I added names to the following routes:
/user/two-factor-authentication => two-factor.toggle
/user/two-factor-qr-code => two-factor.qr-code
/user/two-factor-recovery-codes => two-factor.recovery-codes

Now I can use:

<form method="POST" action="{{ route('two-factor.toggle') }}">
  [...]
</form>

instead

<form method="POST" action="{{ url('/user/two-factor-authentication') }}">
  [...]
</form>

like other routes of Fortify. I used toggle because it enables and disables the 2FA for the user. Maybe a better name is found for that.

The tests can be modified to use route() helper but I don't know if that is really necessary.

@taylorotwell taylorotwell merged commit 4b74e51 into laravel:1.x May 21, 2021
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.

None yet

2 participants