dimanche 13 novembre 2016

Password reset in laravel 5.1

Kindly tell me how to implement the password reset functionality in my Laravel 5.1 application. I am using the JWT to give a user access to the system. Please, tell me how to implement 'forgot passsword' functionality. My web API is consumed by a mobile device and the user will follow the steps given below when a user understands that he has forgotten the password

1) In the login screen user will click 'Forgot password'

2) In the next step, the user will enter the email address and submits.

3) server side code compares the email with all the email registered within the system. If a match is found a link(self-destructing) to reset password is sent to the email address.

4) The user checks his email account to find the link and use it to reset a password.

Right now the code I have in user table is given down below

<?php

namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [
        'name', 'email', 'password',
    ];

    /**
     * The attributes that should be hidden for arrays.
     *
     * @var array
     */
    protected $hidden = [
        'password', 'remember_token',
    ];


     public function events()
    {
        return $this->hasMany(Event::class);
    }


      public function request()
    {
        return $this->hasOne(Request::class);
    }



}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire