mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Ensure cipher is stored in the .env file
This commit is contained in:
parent
8752ac018b
commit
30e9aca6b6
@ -78,10 +78,17 @@ class HandleUserLoggedIn
|
|||||||
Session::flash('error', trans('texts.error_incorrect_gateway_ids'));
|
Session::flash('error', trans('texts.error_incorrect_gateway_ids'));
|
||||||
}
|
}
|
||||||
|
|
||||||
// if APP_KEY isn't set use the default
|
// make sure APP_KEY and APP_CIPHER are in the .env file
|
||||||
if (! env('APP_KEY')) {
|
$appKey = env('APP_KEY');
|
||||||
|
$appCipher = env('APP_CIPHER');
|
||||||
|
if (! $appKey || ! $appCipher) {
|
||||||
$fp = fopen(base_path().'/.env', 'a');
|
$fp = fopen(base_path().'/.env', 'a');
|
||||||
|
if (! $appKey) {
|
||||||
fwrite($fp, "\nAPP_KEY=" . config('app.key'));
|
fwrite($fp, "\nAPP_KEY=" . config('app.key'));
|
||||||
|
}
|
||||||
|
if (! $appCipher) {
|
||||||
|
fwrite($fp, "\nAPP_CIPHER=" . config('app.cipher'));
|
||||||
|
}
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user