Skip to content

Commit 1faf5d1

Browse files
authored
Merge pull request #9 from CachetHQ/2.4
Update from upstream repo CachetHQ/Cachet
2 parents de41c0d + 2913193 commit 1faf5d1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

app/Http/Controllers/AuthController.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
use Illuminate\Support\Facades\Request;
2323
use Illuminate\Support\Facades\Session;
2424
use Illuminate\Support\Facades\View;
25-
use Illuminate\Support\Str;
2625
use PragmaRX\Google2FA\Vendor\Laravel\Facade as Google2FA;
2726

2827
class AuthController extends Controller
@@ -48,7 +47,7 @@ public function postLogin()
4847
$loginData = Binput::only(['username', 'password']);
4948

5049
// Login with username or email.
51-
$loginKey = Str::contains($loginData['username'], '@') ? 'email' : 'username';
50+
$loginKey = filter_var($loginData['username'], FILTER_VALIDATE_EMAIL) ? 'email' : 'username';
5251
$loginData[$loginKey] = array_pull($loginData, 'username');
5352

5453
// Validate login credentials.

0 commit comments

Comments
 (0)