diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-13 02:22:07 +0200 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-13 02:22:07 +0200 |
| commit | d9167fb5318d5370ba5445e94c0e0f9b64341df4 (patch) | |
| tree | e624d80cd4d7ab040214ef85cfbaef31dbbb970d /core/classes/authentication/Token | |
| parent | 33266244e8c75c29f31dd5dce756e55fb10a0b9b (diff) | |
| download | classroom-d9167fb5318d5370ba5445e94c0e0f9b64341df4.tar.gz classroom-d9167fb5318d5370ba5445e94c0e0f9b64341df4.tar.bz2 classroom-d9167fb5318d5370ba5445e94c0e0f9b64341df4.zip | |
authentication skeleton
Diffstat (limited to 'core/classes/authentication/Token')
| -rw-r--r-- | core/classes/authentication/Token/UserToken.php | 32 | ||||
| -rw-r--r-- | core/classes/authentication/Token/UserTokenInterface.php | 18 |
2 files changed, 50 insertions, 0 deletions
diff --git a/core/classes/authentication/Token/UserToken.php b/core/classes/authentication/Token/UserToken.php new file mode 100644 index 0000000..6ce2eb6 --- /dev/null +++ b/core/classes/authentication/Token/UserToken.php @@ -0,0 +1,32 @@ +<?php +/** Class UserToken + * + * @package DevCoder\Authentication + * + */ +// namespace DevCoder\Authentication\Token; + +// use DevCoder\Authentication\UserInterface; + +class UserToken implements UserTokenInterface +{ + /** + * @var UserInterface + */ + private $user; + + public function __construct(UserInterface $user) + { + $this->user = $user; + } + + public function getUser(): UserInterface + { + return $this->user; + } + + public function serialize(): string + { + return serialize($this); + } +} diff --git a/core/classes/authentication/Token/UserTokenInterface.php b/core/classes/authentication/Token/UserTokenInterface.php new file mode 100644 index 0000000..f095a17 --- /dev/null +++ b/core/classes/authentication/Token/UserTokenInterface.php @@ -0,0 +1,18 @@ +<?php +/** Interface UserTokenInterface + * + * @package DevCoder\Authentication\Token + * + */ +// namespace DevCoder\Authentication\Token; + +// use DevCoder\Authentication\UserInterface; + +interface UserTokenInterface +{ + const DEFAULT_PREFIX_KEY = 'user_security'; + + public function getUser(): UserInterface; + + public function serialize(): string; +} |
