mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-05-02 05:14:38 +02:00
Fix calls to Setting instead of User preferences
This commit is contained in:
parent
c5daeb5376
commit
47be24b60f
@ -17,6 +17,7 @@
|
|||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Support\Arr;
|
use Illuminate\Support\Arr;
|
||||||
use Illuminate\Support\Facades\App;
|
use Illuminate\Support\Facades\App;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Crypt;
|
use Illuminate\Support\Facades\Crypt;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
@ -386,7 +387,7 @@ public function fillWithOtpParameters(array $parameters, bool $skipIconFetching
|
|||||||
$this->enforceAsSteam();
|
$this->enforceAsSteam();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $this->icon && Settings::get('getOfficialIcons') && ! $skipIconFetching) {
|
if (! $this->icon && Auth::user()->preferences['getOfficialIcons'] && ! $skipIconFetching) {
|
||||||
$this->icon = $this->getDefaultIcon();
|
$this->icon = $this->getDefaultIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -438,7 +439,7 @@ public function fillWithURI(string $uri, bool $isSteamTotp = false, bool $skipIc
|
|||||||
self::setIcon($this->generator->getParameter('image'));
|
self::setIcon($this->generator->getParameter('image'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $this->icon && Settings::get('getOfficialIcons') && ! $skipIconFetching) {
|
if (! $this->icon && Auth::user()->preferences['getOfficialIcons'] && ! $skipIconFetching) {
|
||||||
$this->icon = $this->getDefaultIcon();
|
$this->icon = $this->getDefaultIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -676,7 +677,7 @@ private function getDefaultIcon()
|
|||||||
{
|
{
|
||||||
$logoService = App::make(LogoService::class);
|
$logoService = App::make(LogoService::class);
|
||||||
|
|
||||||
return Settings::get('getOfficialIcons') ? $logoService->getIcon($this->service) : null;
|
return Auth::user()->preferences['getOfficialIcons'] ? $logoService->getIcon($this->service) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -86,7 +86,7 @@ public function set($setting, $value = null) : void
|
|||||||
|
|
||||||
foreach ($settings as $setting => $value) {
|
foreach ($settings as $setting => $value) {
|
||||||
Option::updateOrCreate(['key' => $setting], ['value' => $value]);
|
Option::updateOrCreate(['key' => $setting], ['value' => $value]);
|
||||||
Log::info(sprintf('Setting "%s" is now %s', var_export($setting, true), var_export($this->restoreType($value), true)));
|
Log::info(sprintf('Setting %s is now %s', var_export($setting, true), var_export($this->restoreType($value), true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
self::buildAndCache();
|
self::buildAndCache();
|
||||||
@ -100,7 +100,7 @@ public function set($setting, $value = null) : void
|
|||||||
public function delete(string $name) : void
|
public function delete(string $name) : void
|
||||||
{
|
{
|
||||||
Option::where('key', $name)->delete();
|
Option::where('key', $name)->delete();
|
||||||
Log::info(sprintf('Setting "%s" deleted', var_export($name, true)));
|
Log::info(sprintf('Setting %s deleted', var_export($name, true)));
|
||||||
|
|
||||||
self::buildAndCache();
|
self::buildAndCache();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user