From f312bd9128d9086fa69c74dbd250e040f115d1fe Mon Sep 17 00:00:00 2001 From: td141 Date: Fri, 20 Nov 2020 23:35:30 +0900 Subject: [PATCH] Modify credentisals --- src/SessionServiceProvider.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/SessionServiceProvider.php b/src/SessionServiceProvider.php index f99ea95..1a49dea 100644 --- a/src/SessionServiceProvider.php +++ b/src/SessionServiceProvider.php @@ -21,15 +21,21 @@ public function boot() Session::extend('dynamodb', function($app) { - $client = new DynamoDbClient([ + + $config = [ 'region' => config('dynamodb-session.region'), 'version' => 'latest', 'endpoint' => config('dynamodb-session.endpoint'), - 'credentials' => [ + ]; + + if (config('dynamodb-session.key') !== null && config('dynamodb-session.secret') !== null){ + $config['credentials'] = [ 'key' => config('dynamodb-session.key'), 'secret' => config('dynamodb-session.secret'), - ], - ]); + ]; + + } + $client = new DynamoDbClient($config); $config = [ 'table_name' => config('dynamodb-session.table_name'),