From 3daa3821ef3ab4d732bf24a0d5caac89b8e30db2 Mon Sep 17 00:00:00 2001 From: Eldad Fux Date: Tue, 18 Mar 2025 10:24:42 +0100 Subject: [PATCH] Fixed syntax error --- app/init/resources.php | 4 +++- src/Appwrite/Auth/Auth.php | 14 ++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/app/init/resources.php b/app/init/resources.php index 41c099ce05..41e70b4e34 100644 --- a/app/init/resources.php +++ b/app/init/resources.php @@ -870,7 +870,9 @@ App::setResource('proofForToken', function (): Token { }); App::setResource('proofForTokenCode', function (): Token { - return new Token()->setLength(6); + $token = new Token(); + $token->setLength(6); + return $token; }); App::setResource('proofForCode', function (): Code { diff --git a/src/Appwrite/Auth/Auth.php b/src/Appwrite/Auth/Auth.php index a6c6e87d4e..a838a9ce75 100644 --- a/src/Appwrite/Auth/Auth.php +++ b/src/Appwrite/Auth/Auth.php @@ -12,11 +12,18 @@ class Auth { /** * @var string + * + * @deprecated We plan to deprecate this class in the future. Use Utopia Auth when possible. */ public static $cookieNamePreview = 'a_jwt_console'; /** * Token type to session provider mapping. + * + * @deprecated We plan to deprecate this class in the future. Use Utopia Auth when possible. + * @param int $type + * + * @return string */ public static function getSessionProviderByTokenType(int $type): string { @@ -41,6 +48,7 @@ class Auth * * One-way encryption * + * @deprecated We plan to deprecate this class in the future. Use Utopia Auth when possible. * @param $string * * @return string @@ -55,6 +63,7 @@ class Auth * * Generate random password string * + * @deprecated We plan to deprecate this class in the future. Use Utopia Auth when possible. * @param int $length Length of returned token * * @return string @@ -74,6 +83,7 @@ class Auth /** * Verify token and check that its not expired. * + * @deprecated We plan to deprecate this class in the future. Use Utopia Auth when possible. * @param array $tokens * @param int $type Type of token to verify, if null will verify any type * @param string $secret @@ -101,6 +111,7 @@ class Auth /** * Verify session and check that its not expired. * + * @deprecated We plan to deprecate this class in the future. Use Utopia Auth when possible. * @param array $sessions * @param string $secret * @@ -125,6 +136,7 @@ class Auth /** * Is Privileged User? * + * @deprecated We plan to deprecate this class in the future. Use Utopia Auth when possible. * @param array $roles * * @return bool @@ -145,6 +157,7 @@ class Auth /** * Is App User? * + * @deprecated We plan to deprecate this class in the future. Use Utopia Auth when possible. * @param array $roles * * @return bool @@ -161,6 +174,7 @@ class Auth /** * Returns all roles for a user. * + * @deprecated We plan to deprecate this class in the future. Use Utopia Auth when possible. * @param Document $user * @return array */