Last active
December 16, 2015 22:49
-
-
Save fhferreira/5509472 to your computer and use it in GitHub Desktop.
Auth Laravel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if (Auth::attempt($credentials)) | |
{ | |
// .. do your redirect | |
} | |
elseif ($user = User::where_email($data['email'])->first() and $user->password == sha1($data['password'])) | |
{ | |
$user->password = Hash::make($data['password']); | |
$user->save(); | |
Auth::login($user->id); | |
} | |
else | |
{ | |
// login failed | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment