mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-19 10:53:31 +00:00
Fix for #1002
This commit is contained in:
@@ -409,7 +409,7 @@ class AccountController extends Controller
|
|||||||
* and for each period, the amount of money spent and earned. This is a complex operation which is cached for
|
* and for each period, the amount of money spent and earned. This is a complex operation which is cached for
|
||||||
* performance reasons.
|
* performance reasons.
|
||||||
*
|
*
|
||||||
* @param Account $account The account involved.
|
* @param Account $account the account involved
|
||||||
*
|
*
|
||||||
* @return Collection
|
* @return Collection
|
||||||
*
|
*
|
||||||
|
@@ -101,7 +101,7 @@ class LoginController extends Controller
|
|||||||
}
|
}
|
||||||
|
|
||||||
// forget 2fa cookie:
|
// forget 2fa cookie:
|
||||||
$cookie = $cookieJar->forever('twoFactorAuthenticated', 'false');
|
$request->session()->forget('twoFactorAuthenticated');
|
||||||
|
|
||||||
// is allowed to?
|
// is allowed to?
|
||||||
$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
$singleUserMode = FireflyConfig::get('single_user_mode', config('firefly.configuration.single_user_mode'))->data;
|
||||||
@@ -114,6 +114,7 @@ class LoginController extends Controller
|
|||||||
$email = $request->old('email');
|
$email = $request->old('email');
|
||||||
$remember = $request->old('remember');
|
$remember = $request->old('remember');
|
||||||
|
|
||||||
return view('auth.login', compact('allowRegistration', 'email', 'remember'))->withCookie($cookie);
|
|
||||||
|
return view('auth.login', compact('allowRegistration', 'email', 'remember'));//->withCookie($cookie);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -96,9 +96,9 @@ class TwoFactorController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function postIndex(TokenFormRequest $request, CookieJar $cookieJar)
|
public function postIndex(TokenFormRequest $request, CookieJar $cookieJar)
|
||||||
{
|
{
|
||||||
// set cookie!
|
// update session, not cookie:
|
||||||
$cookie = $cookieJar->forever('twoFactorAuthenticated', 'true');
|
$request->session()->put('twoFactorAuthenticated', true);
|
||||||
|
|
||||||
return redirect(route('home'))->withCookie($cookie);
|
return redirect(route('home'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -94,7 +94,7 @@ class HomeController extends Controller
|
|||||||
{
|
{
|
||||||
$phpVersion = PHP_VERSION;
|
$phpVersion = PHP_VERSION;
|
||||||
$phpOs = php_uname();
|
$phpOs = php_uname();
|
||||||
$interface = php_sapi_name();
|
$interface = PHP_SAPI;
|
||||||
$now = Carbon::create()->format('Y-m-d H:i:s e');
|
$now = Carbon::create()->format('Y-m-d H:i:s e');
|
||||||
$extensions = join(', ', get_loaded_extensions());
|
$extensions = join(', ', get_loaded_extensions());
|
||||||
$drivers = join(', ', DB::availableDrivers());
|
$drivers = join(', ', DB::availableDrivers());
|
||||||
|
@@ -72,7 +72,6 @@ class NewUserController extends Controller
|
|||||||
/**
|
/**
|
||||||
* @param NewUserFormRequest $request
|
* @param NewUserFormRequest $request
|
||||||
* @param AccountRepositoryInterface $repository
|
* @param AccountRepositoryInterface $repository
|
||||||
*
|
|
||||||
* @param CurrencyRepositoryInterface $currencyRepository
|
* @param CurrencyRepositoryInterface $currencyRepository
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
|
@@ -261,6 +261,7 @@ class ProfileController extends Controller
|
|||||||
* @param string $hash
|
* @param string $hash
|
||||||
*
|
*
|
||||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||||
|
*
|
||||||
* @throws FireflyException
|
* @throws FireflyException
|
||||||
*/
|
*/
|
||||||
public function undoEmailChange(string $token, string $hash)
|
public function undoEmailChange(string $token, string $hash)
|
||||||
|
@@ -133,9 +133,7 @@ class MassController extends Controller
|
|||||||
// skip transactions that have multiple destinations, multiple sources or are an opening balance.
|
// skip transactions that have multiple destinations, multiple sources or are an opening balance.
|
||||||
$filtered = new Collection;
|
$filtered = new Collection;
|
||||||
$messages = [];
|
$messages = [];
|
||||||
/**
|
// @var TransactionJournal
|
||||||
* @var TransactionJournal
|
|
||||||
*/
|
|
||||||
foreach ($journals as $journal) {
|
foreach ($journals as $journal) {
|
||||||
$sources = $journal->sourceAccountList();
|
$sources = $journal->sourceAccountList();
|
||||||
$destinations = $journal->destinationAccountList();
|
$destinations = $journal->destinationAccountList();
|
||||||
|
@@ -64,8 +64,8 @@ class AuthenticateTwoFactor
|
|||||||
$is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
|
$is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
|
||||||
$has2faSecret = null !== Preferences::get('twoFactorAuthSecret');
|
$has2faSecret = null !== Preferences::get('twoFactorAuthSecret');
|
||||||
|
|
||||||
// grab 2auth information from cookie, not from session.
|
// grab 2auth information from session.
|
||||||
$is2faAuthed = 'true' === Cookie::get('twoFactorAuthenticated');
|
$is2faAuthed = true === $request->session()->get('twoFactorAuthenticated');
|
||||||
|
|
||||||
if ($is2faEnabled && $has2faSecret && !$is2faAuthed) {
|
if ($is2faEnabled && $has2faSecret && !$is2faAuthed) {
|
||||||
Log::debug('Does not seem to be 2 factor authed, redirect.');
|
Log::debug('Does not seem to be 2 factor authed, redirect.');
|
||||||
|
@@ -47,8 +47,8 @@ class RedirectIfTwoFactorAuthenticated
|
|||||||
$is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
|
$is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
|
||||||
$has2faSecret = null !== Preferences::get('twoFactorAuthSecret');
|
$has2faSecret = null !== Preferences::get('twoFactorAuthSecret');
|
||||||
|
|
||||||
// grab 2auth information from cookie
|
// grab 2auth information from session.
|
||||||
$is2faAuthed = 'true' === Cookie::get('twoFactorAuthenticated');
|
$is2faAuthed = true === $request->session()->get('twoFactorAuthenticated');
|
||||||
|
|
||||||
if ($is2faEnabled && $has2faSecret && $is2faAuthed) {
|
if ($is2faEnabled && $has2faSecret && $is2faAuthed) {
|
||||||
return redirect('/');
|
return redirect('/');
|
||||||
|
Reference in New Issue
Block a user