1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-16 10:04:21 +02:00

chore(admin-plugin): set default API's tokens on user installation process

This commit is contained in:
Awilum
2020-02-20 10:24:46 +03:00
parent 4022a29a13
commit acb63c9386

View File

@@ -187,6 +187,15 @@ class UsersController extends Controller
], 'yaml')
);
// Set Default API's tokens
$custom_flextype_settings_file_path = PATH['config']['site'] . '/settings.yaml';
$custom_flextype_settings_file_data = $this->parser->decode(Filesystem::read($custom_flextype_settings_file_path), 'yaml');
$custom_flextype_settings_file_data['api']['images']['default_token'] = $api_delivery_images_token;
$custom_flextype_settings_file_data['api']['entries']['default_token'] = $api_delivery_entries_token;
Filesystem::write($custom_flextype_settings_file_path, $this->parser->encode($custom_flextype_settings_file_data, 'yaml'));
return $response->withRedirect($this->router->pathFor('admin.users.login'));
}