Registration error in Laravel

只愿长相守 提交于 2019-12-23 00:31:18

问题


I use the default auth/registration in Laravel 5.3.

When I try to register new user I get error:

FatalThrowableError in RegistersUsers.php line 33:
    Call to undefined method Illuminate\Auth\TokenGuard::login()

I have made some changes in configuration Laravel:

'defaults' => [
        'guard' => 'api',
        'passwords' => 'users',
    ],

So, by default I use api guard


回答1:


The authentication driver api you are trying to use is TokenBased. That means the server will issue your client a Token on successful authentication using credentials. Then, client can present this token to server while making the request to identify itself.

As given in laravel git, there isn't any method as login().

To use the TokenBased Authentication, here's the good guide



来源:https://stackoverflow.com/questions/39321584/registration-error-in-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!