@@ -1235,8 +1235,43 @@ class Account extends Service {
12351235 /// the only valid redirect URLs are the ones from domains you have set when
12361236 /// adding your platforms in the console interface.
12371237 ///
1238+ Future <models.Token > createEmailVerification ({required String url}) async {
1239+ final String apiPath = '/account/verifications/email' ;
1240+
1241+ final Map <String , dynamic > apiParams = {'url' : url};
1242+
1243+ final Map <String , String > apiHeaders = {'content-type' : 'application/json' };
1244+
1245+ final res = await client.call (
1246+ HttpMethod .post,
1247+ path: apiPath,
1248+ params: apiParams,
1249+ headers: apiHeaders,
1250+ );
1251+
1252+ return models.Token .fromMap (res.data);
1253+ }
1254+
1255+ /// Use this endpoint to send a verification message to your user email address
1256+ /// to confirm they are the valid owners of that address. Both the **userId**
1257+ /// and **secret** arguments will be passed as query parameters to the URL you
1258+ /// have provided to be attached to the verification email. The provided URL
1259+ /// should redirect the user back to your app and allow you to complete the
1260+ /// verification process by verifying both the **userId** and **secret**
1261+ /// parameters. Learn more about how to [complete the verification
1262+ /// process](https://appwrite.io/docs/references/cloud/client-web/account#updateVerification).
1263+ /// The verification link sent to the user's email address is valid for 7 days.
1264+ ///
1265+ /// Please note that in order to avoid a [Redirect
1266+ /// Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),
1267+ /// the only valid redirect URLs are the ones from domains you have set when
1268+ /// adding your platforms in the console interface.
1269+ ///
1270+ @Deprecated (
1271+ 'This API has been deprecated since 1.8.0. Please use `Account.createEmailVerification` instead.' ,
1272+ )
12381273 Future <models.Token > createVerification ({required String url}) async {
1239- final String apiPath = '/account/verification ' ;
1274+ final String apiPath = '/account/verifications/email ' ;
12401275
12411276 final Map <String , dynamic > apiParams = {'url' : url};
12421277
@@ -1256,11 +1291,38 @@ class Account extends Service {
12561291 /// the **userId** and **secret** parameters that were attached to your app URL
12571292 /// to verify the user email ownership. If confirmed this route will return a
12581293 /// 200 status code.
1294+ Future <models.Token > updateEmailVerification ({
1295+ required String userId,
1296+ required String secret,
1297+ }) async {
1298+ final String apiPath = '/account/verifications/email' ;
1299+
1300+ final Map <String , dynamic > apiParams = {'userId' : userId, 'secret' : secret};
1301+
1302+ final Map <String , String > apiHeaders = {'content-type' : 'application/json' };
1303+
1304+ final res = await client.call (
1305+ HttpMethod .put,
1306+ path: apiPath,
1307+ params: apiParams,
1308+ headers: apiHeaders,
1309+ );
1310+
1311+ return models.Token .fromMap (res.data);
1312+ }
1313+
1314+ /// Use this endpoint to complete the user email verification process. Use both
1315+ /// the **userId** and **secret** parameters that were attached to your app URL
1316+ /// to verify the user email ownership. If confirmed this route will return a
1317+ /// 200 status code.
1318+ @Deprecated (
1319+ 'This API has been deprecated since 1.8.0. Please use `Account.updateEmailVerification` instead.' ,
1320+ )
12591321 Future <models.Token > updateVerification ({
12601322 required String userId,
12611323 required String secret,
12621324 }) async {
1263- final String apiPath = '/account/verification ' ;
1325+ final String apiPath = '/account/verifications/email ' ;
12641326
12651327 final Map <String , dynamic > apiParams = {'userId' : userId, 'secret' : secret};
12661328
@@ -1285,7 +1347,7 @@ class Account extends Service {
12851347 /// The verification code sent to the user's phone number is valid for 15
12861348 /// minutes.
12871349 Future <models.Token > createPhoneVerification () async {
1288- final String apiPath = '/account/verification /phone' ;
1350+ final String apiPath = '/account/verifications /phone' ;
12891351
12901352 final Map <String , dynamic > apiParams = {};
12911353
@@ -1309,7 +1371,7 @@ class Account extends Service {
13091371 required String userId,
13101372 required String secret,
13111373 }) async {
1312- final String apiPath = '/account/verification /phone' ;
1374+ final String apiPath = '/account/verifications /phone' ;
13131375
13141376 final Map <String , dynamic > apiParams = {'userId' : userId, 'secret' : secret};
13151377
0 commit comments