Laravel Passport密码重置API路线 [英] Laravel Passport Password Reset API route

查看:127
本文介绍了Laravel Passport密码重置API路线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我都在5.5中设置了Passport,并具有自动生成的Auth\ForgotPasswordControllerAuth\ResetPasswordController控制器.

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

尽管为我神奇地提供了/oauth/token,但使用API​​时似乎没有这样的密码重置路径.

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

我的API路由应该是什么样的?

What should my API routes look like?

目前我已经尝试过

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.

/password/email路由也因"message": "Route [password.reset] not defined."

推荐答案

,因为您没有看到除2 custom以外的任何路由,因此我假设您没有运行artisan auth命令.首先运行.它将在您的项目中添加很多路线. 然后将api驱动程序设置为护照.

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.

这篇关于Laravel Passport密码重置API路线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆