-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a9cd63
commit 6b2263a
Showing
3 changed files
with
49 additions
and
11 deletions.
There are no files selected for viewing
38 changes: 38 additions & 0 deletions
38
web/Modules/Customer/App/Http/Middleware/CustomerAuthenticate.php
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,38 @@ | ||
<?php | ||
|
||
namespace Modules\Customer\App\Http\Middleware; | ||
|
||
use Filament\Facades\Filament; | ||
use Filament\Models\Contracts\FilamentUser; | ||
use Illuminate\Auth\Middleware\Authenticate; | ||
use Illuminate\Database\Eloquent\Model; | ||
|
||
class CustomerAuthenticate extends Authenticate | ||
{ | ||
/** | ||
* @param array<string> $guards | ||
*/ | ||
protected function authenticate($request, array $guards): void | ||
{ | ||
$guard = Filament::auth(); | ||
|
||
if (! $guard->check()) { | ||
$this->unauthenticated($request, $guards); | ||
|
||
return; | ||
} | ||
|
||
$this->auth->shouldUse(Filament::getAuthGuard()); | ||
|
||
// /** @var Model $user */ | ||
// $user = $guard->user(); | ||
// | ||
// $panel = Filament::getCurrentPanel(); | ||
|
||
} | ||
|
||
protected function redirectTo($request): ?string | ||
{ | ||
return Filament::getLoginUrl(); | ||
} | ||
} |
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