Skip to content

Commit

Permalink
cookie auth system
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa committed Apr 3, 2019
1 parent 4dfbb0c commit c3f0563
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
12 changes: 12 additions & 0 deletions config/kauth.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@
"iss" => ""
],

/*
|--------------------------------------------------------------------------
| Kauth cookie auth
|--------------------------------------------------------------------------
|
| You can use for socialite system
|
|
*/

"cookie_auth" => false,

/*
|--------------------------------------------------------------------------
| Kauth guard setup
Expand Down
4 changes: 4 additions & 0 deletions src/Token/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public function create($tokenID,$userType){
public function tokon(){
$token_header = Config::get('kauth.token_header_name') ? Config::get('kauth.token_header_name') : 'tokon';
$tokon = \Request::header($token_header);

if(empty($tokon)){
return $_COOKIE[$token_header];
}
return $tokon;
}

Expand Down

0 comments on commit c3f0563

Please sign in to comment.