mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-16 09:22:33 +00:00
Better FF name for multiple accounts.
This commit is contained in:
@@ -30,8 +30,9 @@ class PreferencesController extends Controller
|
|||||||
|
|
||||||
public function code(Google2FA $google2fa)
|
public function code(Google2FA $google2fa)
|
||||||
{
|
{
|
||||||
|
$domain = $this->getDomain();
|
||||||
$secret = $google2fa->generateSecretKey(16, Auth::user()->id);
|
$secret = $google2fa->generateSecretKey(16, Auth::user()->id);
|
||||||
$image = $google2fa->getQRCodeInline("FireflyIII", null, $secret, 150);
|
$image = $google2fa->getQRCodeInline('Firefly III at ' . $domain, null, $secret, 150);
|
||||||
|
|
||||||
|
|
||||||
return view('preferences.code', compact('secret', 'image'));
|
return view('preferences.code', compact('secret', 'image'));
|
||||||
@@ -143,4 +144,15 @@ class PreferencesController extends Controller
|
|||||||
return redirect(route('preferences'));
|
return redirect(route('preferences'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
private function getDomain() : string
|
||||||
|
{
|
||||||
|
$url = url()->to('/');
|
||||||
|
$parts = parse_url($url);
|
||||||
|
|
||||||
|
return $parts['host'];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user