-
-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[6.x] Various updates and fixes (incl. 2FA) (#361)
* Respect Fortify 2FA if using Jetstream. Various fixes for Filament. Remove PHPStan. * Fix breeze migrations * Revert breeze changes to service provider * try again * please... work * fix dumbness * don't seed users table, remove doc blocks from child install drivers * MJ: this is it! * dammit
- Loading branch information
1 parent
f94e4c3
commit 30e056c
Showing
38 changed files
with
441 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
database/migrations/0001_01_01_000000_create_breeze_users_table.php
This file was deleted.
Oops, something went wrong.
51 changes: 0 additions & 51 deletions
51
database/migrations/0001_01_01_000000_create_users_table.php
This file was deleted.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace JoelButcher\Socialstream\Actions; | ||
|
||
use JoelButcher\Socialstream\Contracts\ResolvesSocialiteUsers; | ||
use JoelButcher\Socialstream\Socialstream; | ||
use Laravel\Fortify\Actions\RedirectIfTwoFactorAuthenticatable as BaseAction; | ||
use Laravel\Fortify\Fortify; | ||
|
||
class RedirectIfTwoFactorAuthenticatable extends BaseAction | ||
{ | ||
protected function validateCredentials($request) | ||
{ | ||
if (Fortify::$authenticateUsingCallback) { | ||
return tap(call_user_func(Fortify::$authenticateUsingCallback, $request), function ($user) use ($request) { | ||
if (! $user) { | ||
$this->fireFailedEvent($request); | ||
|
||
$this->throwFailedAuthenticationException($request); | ||
} | ||
}); | ||
} | ||
|
||
$socialUser = app(ResolvesSocialiteUsers::class) | ||
->resolve($request->route('provider')); | ||
|
||
return tap(Socialstream::$userModel::where('email', $socialUser->getEmail())->first(), function ($user) use ($request, $socialUser) { | ||
if (! $user || ! Socialstream::$connectedAccountModel::where('email', $socialUser->getEmail())->first()) { | ||
$this->fireFailedEvent($request, $user); | ||
|
||
$this->throwFailedAuthenticationException($request); | ||
} | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.