Small layout change [skip ci]

This commit is contained in:
James Cole 2017-09-14 16:13:25 +02:00
parent 768c7e53b4
commit afe9d109b3
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E
2 changed files with 30 additions and 2 deletions

View File

@ -2,8 +2,13 @@
namespace FireflyIII\Http\Controllers\Auth;
use FireflyConfig;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\User;
use Illuminate\Cookie\CookieJar;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
class LoginController extends Controller
{
@ -37,4 +42,28 @@ class LoginController extends Controller
parent::__construct();
$this->middleware('guest')->except('logout');
}
/**
* Show the application's login form.
*
* @return \Illuminate\Http\Response
*/
public function showLoginForm(Request $request, CookieJar $cookieJar)
{
// forget 2fa cookie:
$cookie = $cookieJar->forever('twoFactorAuthenticated', 'false');
// is allowed to?
$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
$userCount = User::count();
$allowRegistration = true;
if ($singleUserMode === true && $userCount > 0) {
$allowRegistration = false;
}
$email = $request->old('email');
$remember = $request->old('remember');
return view('auth.login', compact('allowRegistration', 'email', 'remember'))->withCookie($cookie);
}
}

View File

@ -55,8 +55,7 @@ class MailError extends Job implements ShouldQueue
$this->destination = $destination;
$this->ipAddress = $ipAddress;
$this->exception = $exceptionData;
$debug = $exceptionData;
$debug = $exceptionData;
unset($debug['stackTrace']);
Log::error('Exception is: ' . json_encode($debug));
}