Laragear / TwoFactor

Two-Factor Authentication for all your users out-of-the-box.
https://github.com/sponsors/DarkGhostHunter
MIT License
261 stars 20 forks source link

[2.x] FIX: Redirection route in ConfirmTwoFactorCode middleware. #79

Closed Haruki1707 closed 4 months ago

Haruki1707 commented 4 months ago

Adjusted Redirection Route Handling in Middleware.

Description

This fix refines the handling of the first parameter, "$route", in the ConfirmTwoFactorCode Middleware. It ensures the middleware functions correctly when the developer is forcing the middleware to run, without necessarily altering the default route.

Code samples

How to make it work without the fix

Route::get('/example', [ExampleController::class, 'create'])->middleware('2fa.confirm:2fa.confirm,force');

With the fix

Route::get('/example', [ExampleController::class, 'create'])->middleware('2fa.confirm:force');
sonarcloud[bot] commented 4 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

:exclamation: No coverage uploaded for pull request base (2.x@10b658e). Click here to learn what that means.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## 2.x #79 +/- ## ======================================= Coverage ? 100.00% Complexity ? 157 ======================================= Files ? 20 Lines ? 444 Branches ? 0 ======================================= Hits ? 444 Misses ? 0 Partials ? 0 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.