This commit is contained in:
Graham Campbell 2015-12-16 18:11:27 +00:00
commit cfe0cefeb3
17 changed files with 24 additions and 3 deletions

View File

@ -18,6 +18,7 @@ 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
@ -40,7 +41,12 @@ class AuthController extends Controller
*/
public function postLogin()
{
$loginData = Binput::only(['email', 'password']);
$loginData = Binput::only(['login', 'password']);
// Login with username or email.
$loginKey = Str::contains($loginData['login'], '@') ? 'email' : 'username';
$loginData[$loginKey] = array_pull($loginData, 'login');
// Validate login credentials.
if (Auth::validate($loginData)) {
// Log the user in for one request.

View File

@ -27,6 +27,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => 'Email',
'password' => 'Kodeord',
'2fauth' => 'Godkendelses kode',

View File

@ -27,6 +27,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => 'E-Mail',
'password' => 'Passwort',
'2fauth' => 'Authentifizierungscode',

View File

@ -27,6 +27,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => 'crwdns217:0crwdne217:0',
'password' => 'crwdns381:0crwdne381:0',
'2fauth' => 'crwdns382:0crwdne382:0',

View File

@ -27,6 +27,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => 'Email',
'password' => 'Password',
'2fauth' => 'Authentication Code',

View File

@ -25,6 +25,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => 'Correo electrónico',
'password' => 'Contraseña',
'2fauth' => 'Código de Autenticación',

View File

@ -27,6 +27,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => 'Email',
'password' => 'Mot de passe ',
'2fauth' => 'Code d\'authentification',

View File

@ -27,6 +27,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => 'Email',
'password' => 'Password',
'2fauth' => 'Kode Otentikasi',

View File

@ -27,6 +27,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => 'Email',
'password' => 'Password',
'2fauth' => 'Codice di autenticazione',

View File

@ -27,6 +27,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => '이메일',
'password' => '비밀번호',
'2fauth' => '인증 코드',

View File

@ -27,6 +27,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => 'E-mail',
'password' => 'Wachtwoord',
'2fauth' => 'Authenticatie Code',

View File

@ -25,6 +25,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => 'Email',
'password' => 'Hasło',
'2fauth' => 'Kod autentykacji',

View File

@ -27,6 +27,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => 'Email',
'password' => 'Senha',
'2fauth' => 'Código de autenticação',

View File

@ -27,6 +27,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => 'Эл. почта',
'password' => 'Пароль',
'2fauth' => 'Код аутентификации',

View File

@ -27,6 +27,7 @@ return [
// Login form fields
'login' => [
'login' => '用户名或电子邮箱',
'email' => '电子邮箱',
'password' => '密码',
'2fauth' => '双因素验证代码',

View File

@ -27,6 +27,7 @@ return [
// Login form fields
'login' => [
'login' => 'Username or Email',
'email' => '電子郵箱',
'password' => '密碼',
'2fauth' => '雙因素驗證代碼',

View File

@ -30,8 +30,8 @@
@endif
<div class="form-group">
<label class="sr-only">{{ trans('forms.login.email') }}</label>
<input autocomplete="off" class="form-control login-input" placeholder="{{ trans('forms.login.email') }}" required="required" name="email" type="email" autofocus>
<label class="sr-only">{{ trans('forms.login.login') }}</label>
<input autocomplete="off" class="form-control login-input" placeholder="{{ trans('forms.login.login') }}" required="required" name="login" type="text" autofocus>
</div>
<div class="form-group">
<label class="sr-only">{{ trans('forms.login.password') }}</label>