Skip to content

Commit c3f0563

Browse files
author
mostafa
committedApr 3, 2019
cookie auth system
1 parent 4dfbb0c commit c3f0563

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
 

‎config/kauth.php

+12
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@
3838
"iss" => ""
3939
],
4040

41+
/*
42+
|--------------------------------------------------------------------------
43+
| Kauth cookie auth
44+
|--------------------------------------------------------------------------
45+
|
46+
| You can use for socialite system
47+
|
48+
|
49+
*/
50+
51+
"cookie_auth" => false,
52+
4153
/*
4254
|--------------------------------------------------------------------------
4355
| Kauth guard setup

‎src/Token/Token.php

+4
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ public function create($tokenID,$userType){
4040
public function tokon(){
4141
$token_header = Config::get('kauth.token_header_name') ? Config::get('kauth.token_header_name') : 'tokon';
4242
$tokon = \Request::header($token_header);
43+
44+
if(empty($tokon)){
45+
return $_COOKIE[$token_header];
46+
}
4347
return $tokon;
4448
}
4549

0 commit comments

Comments
 (0)