From d849aa1ed2e7303e3ba0ccacaeac30d23adbc3f7 Mon Sep 17 00:00:00 2001 From: Christy Jacob Date: Mon, 29 Jan 2024 16:47:12 +0000 Subject: [PATCH] chore: add logs --- app/controllers/api/account.php | 4 ++++ app/controllers/api/teams.php | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 411103c46..99df2f459 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1336,6 +1336,8 @@ App::post('/v1/account/sessions/phone') $message = $message->setParam('{{token}}', $secret); $message = $message->render(); + var_dump($request->getIP()); + var_dump($project->getId()); $queueForMessaging ->setRecipient($phone) ->setMessage($message) @@ -2936,6 +2938,8 @@ App::post('/v1/account/verification/phone') $message = $message->setParam('{{token}}', $secret); $message = $message->render(); + var_dump($request->getIP()); + var_dump($project->getId()); $queueForMessaging ->setRecipient($user->getAttribute('phone')) ->setMessage($message) diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index a374c57cf..6baad094d 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -380,6 +380,7 @@ App::post('/v1/teams/:teamId/memberships') ->param('roles', [], new ArrayList(new Key(), APP_LIMIT_ARRAY_PARAMS_SIZE), 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of ' . APP_LIMIT_ARRAY_PARAMS_SIZE . ' roles are allowed, each 32 characters long.') ->param('url', '', fn($clients) => new Host($clients), 'URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', true, ['clients']) // TODO add our own built-in confirm page ->param('name', '', new Text(128), 'Name of the new team member. Max length: 128 chars.', true) + ->inject('request') ->inject('response') ->inject('project') ->inject('user') @@ -388,7 +389,7 @@ App::post('/v1/teams/:teamId/memberships') ->inject('queueForMails') ->inject('queueForMessaging') ->inject('queueForEvents') - ->action(function (string $teamId, string $email, string $userId, string $phone, array $roles, string $url, string $name, Response $response, Document $project, Document $user, Database $dbForProject, Locale $locale, Mail $queueForMails, EventPhone $queueForMessaging, Event $queueForEvents) { + ->action(function (string $teamId, string $email, string $userId, string $phone, array $roles, string $url, string $name, Request $request, Response $response, Document $project, Document $user, Database $dbForProject, Locale $locale, Mail $queueForMails, EventPhone $queueForMessaging, Event $queueForEvents) { $isAPIKey = Auth::isAppUser(Authorization::getRoles()); $isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles()); @@ -638,6 +639,8 @@ App::post('/v1/teams/:teamId/memberships') $message = $message->setParam('{{token}}', $url); $message = $message->render(); + var_dump($request->getIP()); + var_dump($project->getId()); $queueForMessaging ->setRecipient($phone) ->setMessage($message)