Move G-Auth import logic from controller to service

This commit is contained in:
Bubka
2022-06-20 17:47:23 +02:00
parent e97f6cfbc6
commit c20e5f79ef
6 changed files with 158 additions and 43 deletions

View File

@ -60,6 +60,11 @@ class Handler extends ExceptionHandler
'message' => $exception->getMessage()], 400);
});
$this->renderable(function (InvalidGoogleAuthMigration $exception, $request) {
return response()->json([
'message' => __('errors.invalid_google_auth_migration')], 400);
});
$this->renderable(function (\Illuminate\Auth\AuthenticationException $exception, $request) {
if ($exception->guards() === ['reverse-proxy-guard']) {
return response()->json([

View File

@ -0,0 +1,14 @@
<?php
namespace App\Exceptions;
use Exception;
/**
* Class UndecipherableException.
*
* @codeCoverageIgnore
*/
class InvalidGoogleAuthMigration extends Exception
{
}