Merge pull request #9 from CachetHQ/2.4

Update from upstream repo CachetHQ/Cachet
This commit is contained in:
Davide Bellini 2016-10-07 18:52:25 +02:00 committed by GitHub
commit 1faf5d1fe1

View File

@ -22,7 +22,6 @@ use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\View;
use Illuminate\Support\Str;
use PragmaRX\Google2FA\Vendor\Laravel\Facade as Google2FA;
class AuthController extends Controller
@ -48,7 +47,7 @@ class AuthController extends Controller
$loginData = Binput::only(['username', 'password']);
// Login with username or email.
$loginKey = Str::contains($loginData['username'], '@') ? 'email' : 'username';
$loginKey = filter_var($loginData['username'], FILTER_VALIDATE_EMAIL) ? 'email' : 'username';
$loginData[$loginKey] = array_pull($loginData, 'username');
// Validate login credentials.