Make oauth nullable & remove middleware from oauth callback (#418)

* make oauth nullable

* fix oauth callback middleware
This commit is contained in:
Boy132 2024-06-18 22:05:08 +02:00 committed by GitHub
parent c431775b7e
commit 7813b6060c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ use App\Notifications\SendPasswordReset as ResetPasswordNotification;
* @property bool $use_totp * @property bool $use_totp
* @property string|null $totp_secret * @property string|null $totp_secret
* @property \Illuminate\Support\Carbon|null $totp_authenticated_at * @property \Illuminate\Support\Carbon|null $totp_authenticated_at
* @property array $oauth * @property array|null $oauth
* @property bool $gravatar * @property bool $gravatar
* @property \Illuminate\Support\Carbon|null $created_at * @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at * @property \Illuminate\Support\Carbon|null $updated_at
@ -165,7 +165,7 @@ class User extends Model implements AuthenticatableContract, AuthorizableContrac
'language' => 'string', 'language' => 'string',
'use_totp' => 'boolean', 'use_totp' => 'boolean',
'totp_secret' => 'nullable|string', 'totp_secret' => 'nullable|string',
'oauth' => 'array', 'oauth' => 'array|nullable',
]; ];
protected function casts(): array protected function casts(): array

View File

@ -20,7 +20,7 @@ Route::get('/password/reset/{token}', [Auth\LoginController::class, 'index'])->n
// Endpoints for OAuth // Endpoints for OAuth
Route::get('/oauth/redirect/{driver}', [Auth\OAuthController::class, 'redirect'])->name('auth.oauth.redirect'); Route::get('/oauth/redirect/{driver}', [Auth\OAuthController::class, 'redirect'])->name('auth.oauth.redirect');
Route::get('/oauth/callback/{driver}', [Auth\OAuthController::class, 'callback'])->name('auth.oauth.callback'); Route::get('/oauth/callback/{driver}', [Auth\OAuthController::class, 'callback'])->name('auth.oauth.callback')->withoutMiddleware('guest');
// Apply a throttle to authentication action endpoints, in addition to the // Apply a throttle to authentication action endpoints, in addition to the
// recaptcha endpoints to slow down manual attack spammers even more. 🤷‍ // recaptcha endpoints to slow down manual attack spammers even more. 🤷‍