rappasoft / laravel-boilerplate

The Laravel Boilerplate Project - https://laravel-boilerplate.com
https://rappasoft.com
5.59k stars 1.58k forks source link

Password expiration middleware to exclude social logins #1578

Closed soringabriel closed 2 years ago

soringabriel commented 2 years ago

https://github.com/rappasoft/laravel-boilerplate/blob/master/app/Domains/Auth/Http/Middleware/PasswordExpires.php#L25

I believe the middleware should have effect only for users that are NOT logged in through social logins (such as google or facebook). That's because those users do not have a password to set for current password when it expires (yet the boilerplate asks for it)

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

bryanrscott commented 2 years ago

I am right this would require setting a session variable when social is used to logon, ie in App\Domains\Auth\Http\Controllers\Frontend\Auth\SocialController callback. by adding something like session(['isSocial' => '1']);

and then checking this variable in the middleware? something like in App\Domains\Auth\Http\Middleware\PasswordExpires handle function if (session('isSocial', '0') == '1') {

or is there a better way?

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.