Titan
Titan

Reputation: 6040

Laravel Passport Password Reset API route

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."

Upvotes: 1

Views: 4610

Answers (1)

user7747472
user7747472

Reputation: 1952

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.

Upvotes: 1

Related Questions