Skip to content

Commit

Permalink
token key name
Browse files Browse the repository at this point in the history
change token_key to token_header_name in config file
  • Loading branch information
mostafa committed Feb 18, 2019
1 parent b1fa1c5 commit 1439762
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions config/kauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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" => "",

/*
|--------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion src/Token/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 1439762

Please sign in to comment.