feat: replace env method call by config (Resolve #11)

pull/12/head
Al-Amin Firdows 3 years ago
parent 3c869ff00c
commit 4cf5c9671e

@ -45,10 +45,9 @@ class UserController extends Controller {
'name' => $creds['name'] 'name' => $creds['name']
]); ]);
$default_user_role_id = env('DEFAULT_ROLE_ID', 2);
UserRole::create([ UserRole::create([
'user_id' => $user->id, 'user_id' => $user->id,
'role_id' => $default_user_role_id 'role_id' => config('hydra.default_user_role_id', 2)
]); ]);
@ -72,7 +71,7 @@ class UserController extends Controller {
return response(['error' => 1, 'message' => 'invalid credentials'], 401); return response(['error' => 1, 'message' => 'invalid credentials'], 401);
} }
if (env('DELETE_PREVIOUS_ACCESS_TOKENS_ON_LOGIN', false) == true) { if (config('hydra.delete_previous_access_tokens_on_login', false)) {
$user->tokens()->delete(); $user->tokens()->delete();
} }

Loading…
Cancel
Save