mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-11-03 19:08:50 +03:00
More encrypt/decrypt improvements to revamp SSO data to be properly encrypted
This commit is contained in:
parent
cda88f438a
commit
9dae4cfa45
5 changed files with 64 additions and 48 deletions
|
|
@ -652,6 +652,9 @@ class ServiceActions
|
|||
return 'Pong';
|
||||
}
|
||||
|
||||
/**
|
||||
* Login with the \RainLoop\API::CreateUserSsoHash() generated hash
|
||||
*/
|
||||
public function ServiceSso() : string
|
||||
{
|
||||
$this->oHttp->ServerNoCache();
|
||||
|
|
@ -668,7 +671,9 @@ class ServiceActions
|
|||
$sSsoSubData = $this->Cacher()->Get(KeyPathHelper::SsoCacherKey($sSsoHash));
|
||||
if (!empty($sSsoSubData))
|
||||
{
|
||||
$mData = Utils::DecodeKeyValuesQ($sSsoSubData);
|
||||
$mData = \array_map('base64_decode', \json_decode($sSsoSubData, true));
|
||||
$mData = \is_array($mData) ? \SnappyMail\Crypt::Decrypt($sSsoSubData, $sSsoHash) : null;
|
||||
|
||||
$this->Cacher()->Delete(KeyPathHelper::SsoCacherKey($sSsoHash));
|
||||
|
||||
if (\is_array($mData) && !empty($mData['Email']) && isset($mData['Password'], $mData['Time']) &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue