@@ -1378,8 +1378,43 @@ class Account extends Service {
13781378 /// the only valid redirect URLs are the ones from domains you have set when
13791379 /// adding your platforms in the console interface.
13801380 ///
1381+ Future <models.Token > createEmailVerification ({required String url}) async {
1382+ const String apiPath = '/account/verifications/email' ;
1383+
1384+ final Map <String , dynamic > apiParams = {'url' : url};
1385+
1386+ final Map <String , String > apiHeaders = {'content-type' : 'application/json' };
1387+
1388+ final res = await client.call (
1389+ HttpMethod .post,
1390+ path: apiPath,
1391+ params: apiParams,
1392+ headers: apiHeaders,
1393+ );
1394+
1395+ return models.Token .fromMap (res.data);
1396+ }
1397+
1398+ /// Use this endpoint to send a verification message to your user email address
1399+ /// to confirm they are the valid owners of that address. Both the **userId**
1400+ /// and **secret** arguments will be passed as query parameters to the URL you
1401+ /// have provided to be attached to the verification email. The provided URL
1402+ /// should redirect the user back to your app and allow you to complete the
1403+ /// verification process by verifying both the **userId** and **secret**
1404+ /// parameters. Learn more about how to [complete the verification
1405+ /// process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification).
1406+ /// The verification link sent to the user's email address is valid for 7 days.
1407+ ///
1408+ /// Please note that in order to avoid a [Redirect
1409+ /// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
1410+ /// the only valid redirect URLs are the ones from domains you have set when
1411+ /// adding your platforms in the console interface.
1412+ ///
1413+ @Deprecated (
1414+ 'This API has been deprecated since 1.8.0. Please use `Account.createEmailVerification` instead.' ,
1415+ )
13811416 Future <models.Token > createVerification ({required String url}) async {
1382- const String apiPath = '/account/verification ' ;
1417+ const String apiPath = '/account/verifications/email ' ;
13831418
13841419 final Map <String , dynamic > apiParams = {'url' : url};
13851420
@@ -1399,11 +1434,38 @@ class Account extends Service {
13991434 /// the **userId** and **secret** parameters that were attached to your app URL
14001435 /// to verify the user email ownership. If confirmed this route will return a
14011436 /// 200 status code.
1437+ Future <models.Token > updateEmailVerification ({
1438+ required String userId,
1439+ required String secret,
1440+ }) async {
1441+ const String apiPath = '/account/verifications/email' ;
1442+
1443+ final Map <String , dynamic > apiParams = {'userId' : userId, 'secret' : secret};
1444+
1445+ final Map <String , String > apiHeaders = {'content-type' : 'application/json' };
1446+
1447+ final res = await client.call (
1448+ HttpMethod .put,
1449+ path: apiPath,
1450+ params: apiParams,
1451+ headers: apiHeaders,
1452+ );
1453+
1454+ return models.Token .fromMap (res.data);
1455+ }
1456+
1457+ /// Use this endpoint to complete the user email verification process. Use both
1458+ /// the **userId** and **secret** parameters that were attached to your app URL
1459+ /// to verify the user email ownership. If confirmed this route will return a
1460+ /// 200 status code.
1461+ @Deprecated (
1462+ 'This API has been deprecated since 1.8.0. Please use `Account.updateEmailVerification` instead.' ,
1463+ )
14021464 Future <models.Token > updateVerification ({
14031465 required String userId,
14041466 required String secret,
14051467 }) async {
1406- const String apiPath = '/account/verification ' ;
1468+ const String apiPath = '/account/verifications/email ' ;
14071469
14081470 final Map <String , dynamic > apiParams = {'userId' : userId, 'secret' : secret};
14091471
@@ -1428,7 +1490,7 @@ class Account extends Service {
14281490 /// The verification code sent to the user's phone number is valid for 15
14291491 /// minutes.
14301492 Future <models.Token > createPhoneVerification () async {
1431- const String apiPath = '/account/verification /phone' ;
1493+ const String apiPath = '/account/verifications /phone' ;
14321494
14331495 final Map <String , dynamic > apiParams = {};
14341496
@@ -1452,7 +1514,7 @@ class Account extends Service {
14521514 required String userId,
14531515 required String secret,
14541516 }) async {
1455- const String apiPath = '/account/verification /phone' ;
1517+ const String apiPath = '/account/verifications /phone' ;
14561518
14571519 final Map <String , dynamic > apiParams = {'userId' : userId, 'secret' : secret};
14581520
0 commit comments