mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-28 09:34:59 +00:00
[wip] first impl for getting authorization for admin
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\CalendarBundle\Synchro\Connector\MSGraph;
|
||||
|
||||
use Chill\MainBundle\Redis\ChillRedis;
|
||||
use TheNetworg\OAuth2\Client\Token\AccessToken;
|
||||
|
||||
class MachineTokenStorage
|
||||
{
|
||||
private const KEY = 'msgraph_access_token';
|
||||
|
||||
private ChillRedis $chillRedis;
|
||||
|
||||
public function __construct(ChillRedis $chillRedis)
|
||||
{
|
||||
$this->chillRedis = $chillRedis;
|
||||
}
|
||||
|
||||
public function getToken(): AccessToken
|
||||
{
|
||||
return unserialize($this->chillRedis->get(self::KEY));
|
||||
}
|
||||
|
||||
public function storeToken(AccessToken $token): void
|
||||
{
|
||||
$this->chillRedis->set(self::KEY, serialize($token));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user