Merge branch 'master' of github.com:appwrite/appwrite
This commit is contained in:
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 |
|
@ -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) {
|
||||
|
|
|
@ -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']];
|
||||
|
||||
|
|
Loading…
Reference in a new issue