Skip to content

Commit

Permalink
updated auth middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
BenRutlandWeb committed Aug 26, 2021
1 parent 787e2a5 commit 58a7199
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 20 deletions.
61 changes: 49 additions & 12 deletions config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,74 @@

/*
|--------------------------------------------------------------------------
| Authentication Provider Default
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "provider". You may
| change this default as required.
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
| Supported: "radiate", "wordpress"
*/

'defaults' => [
'guard' => 'web',
],

/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session"
|
*/

'default' => 'radiate',
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],

# 'api' => [
# 'driver' => 'session',
# 'provider' => 'users',
# ],
],

/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are accessed from the authentication system.
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "wordpress", "radiate"
|
*/

'providers' => [
# 'users' => [
# 'driver' => 'wordpress',
# 'table' => 'users',
# ],

'radiate' => [
'users' => [
'driver' => 'radiate',
'model' => \Theme\Models\User::class,
],

'wordpress' => [
'driver' => 'wordpress',
'model' => \Theme\Models\User::class,
],
],
];
11 changes: 3 additions & 8 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,9 @@
]);

$app->routeMiddleware([
'auth' => Radiate\Auth\Middleware\Authenticate::class,
'ajax' => [
//
],
'api' => [
//
],
'signed' => Radiate\Routing\Middleware\ValidateSignature::class,
'auth' => Radiate\Auth\Middleware\Authenticate::class,
'auth.basic' => Radiate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'signed' => Radiate\Routing\Middleware\ValidateSignature::class,
]);


Expand Down

0 comments on commit 58a7199

Please sign in to comment.