Laravel Passport Password Reset API route

谁说我不能喝 提交于 2019-12-11 07:56:30

问题


I'm all set up with Passport in 5.5 and have the auto generated Auth\ForgotPasswordController and Auth\ResetPasswordController controllers.

However whereas /oauth/token was provided magically for me, there don't appear to be such routes for password reset when using the API.

What should my API routes look like?

Currently I've experimented with

Route::group(['prefix' => 'password'], function () {
    Route::post('/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
    Route::post('/reset', 'Auth\ResetPasswordController@reset');
});

but I found these in the vendor files when looking at the traits and aren't sure if this is the correct way.

The /password/email route also fails with "message": "Route [password.reset] not defined."


回答1:


since you don't see any route other then 2 custom, therefore i am assumin you havn't run artisan auth command. First run that. it will add lot of routes in ur project. Then set api driver to passport.



来源:https://stackoverflow.com/questions/47930940/laravel-passport-password-reset-api-route

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