1
0
Fork 0
mirror of synced 2024-06-26 18:20:43 +12:00

Merge branch 'master' of github.com:appwrite/appwrite

This commit is contained in:
Eldad Fux 2021-05-24 19:14:13 +03:00
commit 82abcb29ae
3 changed files with 12 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View file

@ -714,10 +714,16 @@ App::post('/v1/account/sessions/anonymous')
$detector->getDevice()
));
$user->setAttribute('sessions', $session, Document::SET_TYPE_APPEND);
Authorization::setRole('user:'.$user->getId());
$session = $projectDB->createDocument($session->getArrayCopy());
if (false === $session) {
throw new Exception('Failed saving session to DB', 500);
}
$user->setAttribute('sessions', $session, Document::SET_TYPE_APPEND);
$user = $projectDB->updateDocument($user->getArrayCopy());
if (false === $user) {

View file

@ -240,6 +240,10 @@ class AccountCustomClientTest extends Scope
]);
$this->assertEquals(201, $response['headers']['status-code']);
$this->assertIsArray($response['body']);
$this->assertNotEmpty($response['body']);
$this->assertNotEmpty($response['body']['$id']);
$this->assertNotEmpty($response['body']['userId']);
$session = $this->client->parseCookie((string)$response['headers']['set-cookie'])['a_session_'.$this->getProject()['$id']];