@@ -1308,6 +1308,52 @@ def create_phone_token(user_id:, phone:)
13081308 )
13091309 end
13101310
1311+ # Use this endpoint to send a verification message to your user email address
1312+ # to confirm they are the valid owners of that address. Both the **userId**
1313+ # and **secret** arguments will be passed as query parameters to the URL you
1314+ # have provided to be attached to the verification email. The provided URL
1315+ # should redirect the user back to your app and allow you to complete the
1316+ # verification process by verifying both the **userId** and **secret**
1317+ # parameters. Learn more about how to [complete the verification
1318+ # process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification).
1319+ # The verification link sent to the user's email address is valid for 7 days.
1320+ #
1321+ # Please note that in order to avoid a [Redirect
1322+ # Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
1323+ # the only valid redirect URLs are the ones from domains you have set when
1324+ # adding your platforms in the console interface.
1325+ #
1326+ #
1327+ # @param [String] url URL to redirect the user back to your app from the verification 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.
1328+ #
1329+ # @return [Token]
1330+ def create_email_verification ( url :)
1331+ api_path = '/account/verifications/email'
1332+
1333+ if url . nil?
1334+ raise Appwrite ::Exception . new ( 'Missing required parameter: "url"' )
1335+ end
1336+
1337+ api_params = {
1338+ url : url ,
1339+ }
1340+
1341+ api_headers = {
1342+ "content-type" : 'application/json' ,
1343+ }
1344+
1345+ @client . call (
1346+ method : 'POST' ,
1347+ path : api_path ,
1348+ headers : api_headers ,
1349+ params : api_params ,
1350+ response_type : Models ::Token
1351+ )
1352+ end
1353+
1354+ #
1355+ # @deprecated This API has been deprecated since 1.8.0. Please use `Account.createEmailVerification` instead.
1356+ #
13111357 # Use this endpoint to send a verification message to your user email address
13121358 # to confirm they are the valid owners of that address. Both the **userId**
13131359 # and **secret** arguments will be passed as query parameters to the URL you
@@ -1328,7 +1374,7 @@ def create_phone_token(user_id:, phone:)
13281374 #
13291375 # @return [Token]
13301376 def create_verification ( url :)
1331- api_path = '/account/verification '
1377+ api_path = '/account/verifications/email '
13321378
13331379 if url . nil?
13341380 raise Appwrite ::Exception . new ( 'Missing required parameter: "url"' )
@@ -1351,6 +1397,47 @@ def create_verification(url:)
13511397 )
13521398 end
13531399
1400+ # Use this endpoint to complete the user email verification process. Use both
1401+ # the **userId** and **secret** parameters that were attached to your app URL
1402+ # to verify the user email ownership. If confirmed this route will return a
1403+ # 200 status code.
1404+ #
1405+ # @param [String] user_id User ID.
1406+ # @param [String] secret Valid verification token.
1407+ #
1408+ # @return [Token]
1409+ def update_email_verification ( user_id :, secret :)
1410+ api_path = '/account/verifications/email'
1411+
1412+ if user_id . nil?
1413+ raise Appwrite ::Exception . new ( 'Missing required parameter: "userId"' )
1414+ end
1415+
1416+ if secret . nil?
1417+ raise Appwrite ::Exception . new ( 'Missing required parameter: "secret"' )
1418+ end
1419+
1420+ api_params = {
1421+ userId : user_id ,
1422+ secret : secret ,
1423+ }
1424+
1425+ api_headers = {
1426+ "content-type" : 'application/json' ,
1427+ }
1428+
1429+ @client . call (
1430+ method : 'PUT' ,
1431+ path : api_path ,
1432+ headers : api_headers ,
1433+ params : api_params ,
1434+ response_type : Models ::Token
1435+ )
1436+ end
1437+
1438+ #
1439+ # @deprecated This API has been deprecated since 1.8.0. Please use `Account.updateEmailVerification` instead.
1440+ #
13541441 # Use this endpoint to complete the user email verification process. Use both
13551442 # the **userId** and **secret** parameters that were attached to your app URL
13561443 # to verify the user email ownership. If confirmed this route will return a
@@ -1361,7 +1448,7 @@ def create_verification(url:)
13611448 #
13621449 # @return [Token]
13631450 def update_verification ( user_id :, secret :)
1364- api_path = '/account/verification '
1451+ api_path = '/account/verifications/email '
13651452
13661453 if user_id . nil?
13671454 raise Appwrite ::Exception . new ( 'Missing required parameter: "userId"' )
@@ -1401,7 +1488,7 @@ def update_verification(user_id:, secret:)
14011488 #
14021489 # @return [Token]
14031490 def create_phone_verification ( )
1404- api_path = '/account/verification /phone'
1491+ api_path = '/account/verifications /phone'
14051492
14061493 api_params = {
14071494 }
@@ -1429,7 +1516,7 @@ def create_phone_verification()
14291516 #
14301517 # @return [Token]
14311518 def update_phone_verification ( user_id :, secret :)
1432- api_path = '/account/verification /phone'
1519+ api_path = '/account/verifications /phone'
14331520
14341521 if user_id . nil?
14351522 raise Appwrite ::Exception . new ( 'Missing required parameter: "userId"' )
0 commit comments