1

I use google authenticator to add in laravel-admin

in post to new page /auth/auth , always be redirect to /auth/login, because

“/auth/auth” not in admin.auth.excepts

how do I solve this problem without edit

/vendor/composer/encore/laravel-admin/src/Middleware/Authenticate.php

I have tried to override Authenticate.php by copying Authenticate.php to app/http/Middleware but doesn't work

from

protected function shouldPassThrough($request)
{
$excepts = config('admin.auth.excepts', [
'auth/login',
'auth/logout',
]);

to

protected function shouldPassThrough($request)
{
$excepts = config('admin.auth.excepts', [
'auth/login',
'auth/logout',
'auth/auth'
]);

I want to post /auth/login to /auth/auth (with google authenticator) then login to laravel-admin

David
  • 33,444
  • 11
  • 80
  • 118
James Lin
  • 11
  • 1
  • 5

1 Answers1

0

you can simply add follow code in app/config/admin.php

'auth' => [

.....

// The URIs that should be excluded from authorization.

        'excepts' => [
            'auth/login',
            'auth/logout',
            'auth/auth
        ],
.....
],
SuperStar518
  • 2,814
  • 2
  • 20
  • 35
James Lin
  • 11
  • 1
  • 5