From 7fcc22228c518eb10788715c837aed6b3d922407 Mon Sep 17 00:00:00 2001 From: wess Date: Fri, 12 Aug 2022 09:26:14 -0400 Subject: [PATCH] working on _uid --- app/controllers/api/account.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 0096268af9..1a279a3301 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -306,6 +306,7 @@ App::get('/v1/account/sessions/oauth2/:provider') $oauth2 = new $className($appId, $appSecret, $callback, ['success' => $success, 'failure' => $failure], $scopes); + $response ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') ->addHeader('Pragma', 'no-cache') @@ -491,8 +492,11 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') } try { - $userId = ID::unique(); - $user = Authorization::skip(fn () => $dbForProject->createDocument('users', new Document([ + echo "ACCOUNT.PHP --------- \n"; + $userId = $dbForProject->getId(); + var_dump($userId); + + $user = Authorization::skip(fn() => $dbForProject->createDocument('users', new Document([ '$id' => $userId, '$permissions' => [ Permission::read(Role::any()), @@ -515,6 +519,8 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') 'memberships' => null, 'search' => implode(' ', [$userId, $email, $name]), ]))); + + var_dump($user->getId()); } catch (Duplicate $th) { throw new Exception(Exception::USER_ALREADY_EXISTS); }