mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Fix for #1002
This commit is contained in:
parent
5f127b7bec
commit
e8e0a44cca
@ -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
|
||||
* performance reasons.
|
||||
*
|
||||
* @param Account $account The account involved.
|
||||
* @param Account $account the account involved
|
||||
*
|
||||
* @return Collection
|
||||
*
|
||||
|
@ -101,7 +101,7 @@ class LoginController extends Controller
|
||||
}
|
||||
|
||||
// forget 2fa cookie:
|
||||
$cookie = $cookieJar->forever('twoFactorAuthenticated', 'false');
|
||||
$request->session()->forget('twoFactorAuthenticated');
|
||||
|
||||
// is allowed to?
|
||||
$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');
|
||||
$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)
|
||||
{
|
||||
// set cookie!
|
||||
$cookie = $cookieJar->forever('twoFactorAuthenticated', 'true');
|
||||
// update session, not cookie:
|
||||
$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;
|
||||
$phpOs = php_uname();
|
||||
$interface = php_sapi_name();
|
||||
$interface = PHP_SAPI;
|
||||
$now = Carbon::create()->format('Y-m-d H:i:s e');
|
||||
$extensions = join(', ', get_loaded_extensions());
|
||||
$drivers = join(', ', DB::availableDrivers());
|
||||
@ -211,7 +211,7 @@ class HomeController extends Controller
|
||||
|
||||
return view(
|
||||
'index',
|
||||
compact('count', 'subTitle', 'transactions', 'showDeps', 'billCount','start','end','today')
|
||||
compact('count', 'subTitle', 'transactions', 'showDeps', 'billCount', 'start', 'end', 'today')
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -100,7 +100,7 @@ class JavascriptController extends Controller
|
||||
$currencyId = intval($account->getMeta('currency_id'));
|
||||
}
|
||||
/** @var TransactionCurrency $currency */
|
||||
$currency = $currencyRepository->find($currencyId);
|
||||
$currency = $currencyRepository->find($currencyId);
|
||||
if (0 === $currencyId) {
|
||||
$currency = app('amount')->getDefaultCurrency();
|
||||
}
|
||||
|
@ -72,7 +72,6 @@ class NewUserController extends Controller
|
||||
/**
|
||||
* @param NewUserFormRequest $request
|
||||
* @param AccountRepositoryInterface $repository
|
||||
*
|
||||
* @param CurrencyRepositoryInterface $currencyRepository
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
|
@ -261,6 +261,7 @@ class ProfileController extends Controller
|
||||
* @param string $hash
|
||||
*
|
||||
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
|
||||
*
|
||||
* @throws FireflyException
|
||||
*/
|
||||
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.
|
||||
$filtered = new Collection;
|
||||
$messages = [];
|
||||
/**
|
||||
* @var TransactionJournal
|
||||
*/
|
||||
// @var TransactionJournal
|
||||
foreach ($journals as $journal) {
|
||||
$sources = $journal->sourceAccountList();
|
||||
$destinations = $journal->destinationAccountList();
|
||||
|
@ -64,8 +64,8 @@ class AuthenticateTwoFactor
|
||||
$is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
|
||||
$has2faSecret = null !== Preferences::get('twoFactorAuthSecret');
|
||||
|
||||
// grab 2auth information from cookie, not from session.
|
||||
$is2faAuthed = 'true' === Cookie::get('twoFactorAuthenticated');
|
||||
// grab 2auth information from session.
|
||||
$is2faAuthed = true === $request->session()->get('twoFactorAuthenticated');
|
||||
|
||||
if ($is2faEnabled && $has2faSecret && !$is2faAuthed) {
|
||||
Log::debug('Does not seem to be 2 factor authed, redirect.');
|
||||
|
@ -47,8 +47,8 @@ class RedirectIfTwoFactorAuthenticated
|
||||
$is2faEnabled = Preferences::get('twoFactorAuthEnabled', false)->data;
|
||||
$has2faSecret = null !== Preferences::get('twoFactorAuthSecret');
|
||||
|
||||
// grab 2auth information from cookie
|
||||
$is2faAuthed = 'true' === Cookie::get('twoFactorAuthenticated');
|
||||
// grab 2auth information from session.
|
||||
$is2faAuthed = true === $request->session()->get('twoFactorAuthenticated');
|
||||
|
||||
if ($is2faEnabled && $has2faSecret && $is2faAuthed) {
|
||||
return redirect('/');
|
||||
|
@ -87,7 +87,7 @@ class BudgetRepository implements BudgetRepositoryInterface
|
||||
/** @var AccountRepositoryInterface $accountRepository */
|
||||
$accountRepository = app(AccountRepositoryInterface::class);
|
||||
$accounts = $accountRepository->getAccountsByType([AccountType::DEFAULT, AccountType::ASSET]);
|
||||
$defaultCurrency = app('amount')->getDefaultCurrency();
|
||||
$defaultCurrency = app('amount')->getDefaultCurrency();
|
||||
$return = [];
|
||||
/** @var Budget $budget */
|
||||
foreach ($budgets as $budget) {
|
||||
|
Loading…
Reference in New Issue
Block a user