1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Ensure cipher is stored in the .env file

This commit is contained in:
Hillel Coren 2017-07-26 12:22:38 +03:00
parent 8752ac018b
commit 30e9aca6b6

View File

@ -78,10 +78,17 @@ class HandleUserLoggedIn
Session::flash('error', trans('texts.error_incorrect_gateway_ids'));
}
// if APP_KEY isn't set use the default
if (! env('APP_KEY')) {
// make sure APP_KEY and APP_CIPHER are in the .env file
$appKey = env('APP_KEY');
$appCipher = env('APP_CIPHER');
if (! $appKey || ! $appCipher) {
$fp = fopen(base_path().'/.env', 'a');
fwrite($fp, "\nAPP_KEY=" . config('app.key'));
if (! $appKey) {
fwrite($fp, "\nAPP_KEY=" . config('app.key'));
}
if (! $appCipher) {
fwrite($fp, "\nAPP_CIPHER=" . config('app.cipher'));
}
fclose($fp);
}