diff --git a/README.md b/README.md index 24089ff..e56a729 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,9 @@ php artisan vendor:publish --provider="Kauth\KauthServiceProvider" --tag=migatio * `config\kauth.php` +~ set token_header_name that you can use with guzzle or axios header +~ default token_header_name name is `tokon` + # Usage ## `Kauth::attempt()` functions diff --git a/config/kauth.php b/config/kauth.php index 44bdac9..00b84fe 100644 --- a/config/kauth.php +++ b/config/kauth.php @@ -3,14 +3,15 @@ return [ /* |-------------------------------------------------------------------------- - | Kauth token key + | Kauth token key name |-------------------------------------------------------------------------- | - | You can set your desired token key for request header - | client side / axios headers name + | You can set your desired token key name for request header + | client side / axios headers name as (Authorization) + | default is tokon */ - "token_key" => "", + "token_header_name" => "", /* |-------------------------------------------------------------------------- diff --git a/src/Token/Token.php b/src/Token/Token.php index b116e58..f9c68d0 100644 --- a/src/Token/Token.php +++ b/src/Token/Token.php @@ -38,7 +38,7 @@ public function create($tokenID,$userType){ } public function tokon(){ - $token_header = Config::get('kauth.token_key') ? Config::get('kauth.token_key') : 'tokon'; + $token_header = Config::get('kauth.token_header_name') ? Config::get('kauth.token_header_name') : 'tokon'; $tokon = \Request::header($token_header); return $tokon; }