Skip to content

Commit

Permalink
fix(config): put environment variables into config file (#304)
Browse files Browse the repository at this point in the history
parameters from .env is only read at boot stage - then, configuration
files are used.

laravel/framework#21727
  • Loading branch information
warlof authored May 19, 2019
1 parent 3be5e4d commit e21361a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function showLoginForm()
{

// Warn if SSO has not been configured yet.
if (strlen(env('EVE_CLIENT_SECRET')) < 5 || strlen(env('EVE_CLIENT_ID')) < 5)
if (strlen(config('eveapi.config.eseye_client_secret')) < 5 || strlen(config('eveapi.config.eseye_client_id')) < 5)
session()->flash('warning', trans('web::seat.sso_config_warning'));

return view('web::auth.login');
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Controllers/Configuration/SeatController.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public function getView()
$packages = $this->getPluginsMetadataList();

// Validate SSO Environment settings
if (is_null(env('EVE_CLIENT_ID')) or
is_null(env('EVE_CLIENT_SECRET')) or
is_null(env('EVE_CALLBACK_URL'))
if (is_null(config('eveapi.config.eseye_client_id')) or
is_null(config('eveapi.config.eseye_client_secret')) or
is_null(config('eveapi.config.eseye_client_callback'))
)
$warn_sso = true;
else
Expand Down
12 changes: 6 additions & 6 deletions src/resources/views/configuration/sso/view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<dl>
<dt>{{ trans('web::seat.client_id_status') }}</dt>
<dd>
@if(strlen(env('EVE_CLIENT_ID')) > 5)
@if(strlen(config('eveapi.config.eseye_client_id')) > 5)
<p class="text-green">{{ trans('web::seat.client_id_ok') }}</p>
@else
<p class="text-red">{{ trans('web::seat.client_id_not_ok') }}</p>
Expand All @@ -79,7 +79,7 @@

<dt>{{ trans('web::seat.client_secret_status') }}</dt>
<dd>
@if(strlen(env('EVE_CLIENT_SECRET')) > 5)
@if(strlen(config('eveapi.config.eseye_client_secret')) > 5)
<p class="text-green">{{ trans('web::seat.client_secret_ok') }}</p>
@else
<p class="text-red">{{ trans('web::seat.client_secret_not_ok') }}</p>
Expand All @@ -88,11 +88,11 @@

<dt>{{ trans('web::seat.callback_url_status') }}</dt>
<dd>
@if(env('EVE_CALLBACK_URL') == route('auth.eve.callback'))
<p class="text-green">{{ trans('web::seat.callback_url_ok', ['url' => env('EVE_CALLBACK_URL')]) }}</p>
@elseif(strlen(env('EVE_CALLBACK_URL')) > 5)
@if(config('eveapi.config.eseye_client_callback') == route('auth.eve.callback'))
<p class="text-green">{{ trans('web::seat.callback_url_ok', ['url' => config('eveapi.config.eseye_client_callback')]) }}</p>
@elseif(strlen(config('eveapi.config.eseye_client_callback')) > 5)
<p class="text-yellow">
{{ trans('web::seat.callback_maybe_wrong', ['current' => env('EVE_CALLBACK_URL'), 'suggested' => route('auth.eve.callback')]) }}
{{ trans('web::seat.callback_maybe_wrong', ['current' => config('eveapi.config.eseye_client_callback'), 'suggested' => route('auth.eve.callback')]) }}
</p>
@else
<p class="text-red">{{ trans('web::seat.client_callback_not_ok', ['url' => route('auth.eve.callback')]) }}</p>
Expand Down

0 comments on commit e21361a

Please sign in to comment.