Initial commit
This commit is contained in:
commit
efa5624dab
687 changed files with 162710 additions and 0 deletions
43
kirby/src/Http/Request/Auth/SessionAuth.php
Normal file
43
kirby/src/Http/Request/Auth/SessionAuth.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
|
||||
namespace Kirby\Http\Request\Auth;
|
||||
|
||||
use Kirby\Cms\App;
|
||||
use Kirby\Http\Request\Auth;
|
||||
use Kirby\Session\Session;
|
||||
|
||||
/**
|
||||
* Authentication data using Kirby's session
|
||||
*
|
||||
* @package Kirby Http
|
||||
* @author Lukas Bestle <lukas@getkirby.com>
|
||||
* @link https://getkirby.com
|
||||
* @copyright Bastian Allgeier
|
||||
* @license https://opensource.org/licenses/MIT
|
||||
*/
|
||||
class SessionAuth extends Auth
|
||||
{
|
||||
/**
|
||||
* Tries to return the session object
|
||||
*/
|
||||
public function session(): Session
|
||||
{
|
||||
return App::instance()->sessionHandler()->getManually($this->data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the session token
|
||||
*/
|
||||
public function token(): string
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the authentication type
|
||||
*/
|
||||
public function type(): string
|
||||
{
|
||||
return 'session';
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue