29.07.2016 Views

laravel-5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Authentication 155<br />

.<br />

27 <br />

After Resetting Passwords<br />

Once you have defined the routes and views to reset your user’s passwords, you may simply access<br />

the routes in your browser. The PasswordController included with the framework already includes<br />

the logic to send the password reset link e-mails as well as update passwords in the database.<br />

After the password is reset, the user will automatically be logged into the application and redirected<br />

to /home. You can customize the post password reset redirect location by defining a redirectTo<br />

property on the PasswordController:<br />

.<br />

1 protected $redirectTo = '/dashboard';<br />

Note: By default, password reset tokens expire after one hour. You may change this via the<br />

reminder.expire option in your config/auth.php file.<br />

Social Authentication<br />

In addition to typical, form based authentication, Laravel also provides a simple, convenient<br />

way to authenticate with OAuth providers using Laravel Socialite¹²⁸. Socialite currently supports<br />

authentication with Facebook, Twitter, LinkedIn, Google, GitHub and Bitbucket.<br />

To get started with Socialite, add to your composer.json file as a dependency:<br />

.<br />

1 composer require <strong>laravel</strong>/socialite<br />

Configuration<br />

After installing the Socialite library, register the Laravel\Socialite\SocialiteServiceProvider<br />

in your config/app.php configuration file:<br />

¹²⁸https://github.com/<strong>laravel</strong>/socialite

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!