0
votes

Basically I need change password form in edit profile view after users logged in.

I already using password reset function for guest users. is there any interface to change password or method to override in laravel 5. Do I need to write some method in UserController or Auth Controller ?

Here is my route file:

Route::get('/', 'HomeController@index');
Route::resource('user', 'UserController');

Route::controllers([
'auth' => 'Auth\AuthController',
'password' => 'Auth\PasswordController',
]);

Also I have a UserController with default CRUD methods.

class UserController extends Controller {
    public function index()
    {
    }
    .....
    .....
}
1
Logged in users could use a password reset functionality for guests as well. And yeah, you can write an action to change user's password.buzdykg
so how do I store password with encryption same as in laravel 5 default password reset option. what is the best practise in laravel 5. do i override postReset method? >Illuminate\Contracts\Auth\Guard; >Illuminate\Contracts\Auth\PasswordBroker; >Illuminate\Foundation\Auth\ResetsPasswords; can i use these class to do that easily ?Chanuka Asanka
You can try to locate login method and see how a provided password string is being hashed. Then just store the password the same way.buzdykg
Am just seeing this question and am wondering if its late to provide answer. You can fully customize password reset for authenticated users or prompt users that registered with socialite to choose a password for their accounts if you still need this answer let me knowEmeka Mbah

1 Answers

0
votes

In Laravel 5.1.20, I made the following changes:

App/Http/Auth/PasswordController.php

public function __construct()
{
    $this->middleware('RedirectIfAuthenticated', ['except' => ['getReset', 'postReset']]);
}

And send the link with the Password facade:

Password::sendResetLink($request->only('email'), function (Message $message) {
    $message->subject('Reset link password');
});