Implement new password verifier #1187

This commit is contained in:
James Cole
2018-03-08 20:44:56 +01:00
parent bc32bc8831
commit 79d0450c77
3 changed files with 77 additions and 20 deletions

View File

@@ -22,14 +22,13 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers\Auth;
use DB;
use FireflyConfig;
use FireflyIII\Http\Controllers\Controller;
use FireflyIII\Models\TransactionCurrency;
use FireflyIII\User;
use Illuminate\Cookie\CookieJar;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;
use Schema;
/**
* @codeCoverageIgnore
@@ -123,23 +122,9 @@ class LoginController extends Controller
*/
public function showLoginForm(Request $request)
{
// check for presence of tables:
$hasTable = Schema::hasTable('users');
if (!$hasTable) {
$message
= 'Firefly III could not find the "users" table. This is a strong indication your database credentials are wrong or the database has not been initialized. Did you follow the installation instructions correctly?';
return view('error', compact('message'));
}
// check for presence of currency:
$currency = TransactionCurrency::where('code', 'EUR')->first();
if (null === $currency) {
$message
= 'Firefly III could not find the EURO currency. This is a strong indication the database has not been initialized correctly. Did you follow the installation instructions?';
return view('error', compact('message'));
$count = DB::table('users')->count();
if ($count === 0) {
return redirect(route('register')); // @codeCoverageIgnore
}
// forget 2fa session thing.