@@ -350,6 +350,8 @@ open class Account: Service {
350
350
///
351
351
/// Update MFA
352
352
///
353
+ /// Enable or disable MFA on an account.
354
+ ///
353
355
/// @param Bool mfa
354
356
/// @throws Exception
355
357
/// @return array
@@ -384,6 +386,8 @@ open class Account: Service {
384
386
///
385
387
/// Update MFA
386
388
///
389
+ /// Enable or disable MFA on an account.
390
+ ///
387
391
/// @param Bool mfa
388
392
/// @throws Exception
389
393
/// @return array
@@ -433,6 +437,8 @@ open class Account: Service {
433
437
///
434
438
/// Create MFA Challenge (confirmation)
435
439
///
440
+ /// Complete the MFA challenge by providing the one-time password.
441
+ ///
436
442
/// @param String challengeId
437
443
/// @param String otp
438
444
/// @throws Exception
@@ -463,6 +469,8 @@ open class Account: Service {
463
469
///
464
470
/// List Factors
465
471
///
472
+ /// List the factors available on the account to be used as a MFA challange.
473
+ ///
466
474
/// @throws Exception
467
475
/// @return array
468
476
///
@@ -492,6 +500,11 @@ open class Account: Service {
492
500
///
493
501
/// Add Authenticator
494
502
///
503
+ /// Add an authenticator app to be used as an MFA factor. Verify the
504
+ /// authenticator using the [verify
505
+ /// authenticator](/docs/references/cloud/client-web/account#verifyAuthenticator)
506
+ /// method.
507
+ ///
495
508
/// @param AppwriteEnums.AuthenticatorType type
496
509
/// @throws Exception
497
510
/// @return array
@@ -524,6 +537,10 @@ open class Account: Service {
524
537
///
525
538
/// Verify Authenticator
526
539
///
540
+ /// Verify an authenticator app after adding it using the [add
541
+ /// authenticator](/docs/references/cloud/client-web/account#addAuthenticator)
542
+ /// method.
543
+ ///
527
544
/// @param AppwriteEnums.AuthenticatorType type
528
545
/// @param String otp
529
546
/// @throws Exception
@@ -561,6 +578,10 @@ open class Account: Service {
561
578
///
562
579
/// Verify Authenticator
563
580
///
581
+ /// Verify an authenticator app after adding it using the [add
582
+ /// authenticator](/docs/references/cloud/client-web/account#addAuthenticator)
583
+ /// method.
584
+ ///
564
585
/// @param AppwriteEnums.AuthenticatorType type
565
586
/// @param String otp
566
587
/// @throws Exception
@@ -580,6 +601,8 @@ open class Account: Service {
580
601
///
581
602
/// Delete Authenticator
582
603
///
604
+ /// Delete an authenticator for a user by ID.
605
+ ///
583
606
/// @param AppwriteEnums.AuthenticatorType type
584
607
/// @param String otp
585
608
/// @throws Exception
@@ -617,6 +640,8 @@ open class Account: Service {
617
640
///
618
641
/// Delete Authenticator
619
642
///
643
+ /// Delete an authenticator for a user by ID.
644
+ ///
620
645
/// @param AppwriteEnums.AuthenticatorType type
621
646
/// @param String otp
622
647
/// @throws Exception
@@ -1158,7 +1183,7 @@ open class Account: Service {
1158
1183
}
1159
1184
1160
1185
///
1161
- /// Create session (deprecated)
1186
+ /// Update magic URL session
1162
1187
///
1163
1188
/// Use this endpoint to create a session from token. Provide the **userId**
1164
1189
/// and **secret** parameters from the successful response of authentication
@@ -1254,6 +1279,46 @@ open class Account: Service {
1254
1279
return true
1255
1280
}
1256
1281
1282
+ ///
1283
+ /// Update phone session
1284
+ ///
1285
+ /// Use this endpoint to create a session from token. Provide the **userId**
1286
+ /// and **secret** parameters from the successful response of authentication
1287
+ /// flows initiated by token creation. For example, magic URL and phone login.
1288
+ ///
1289
+ /// @param String userId
1290
+ /// @param String secret
1291
+ /// @throws Exception
1292
+ /// @return array
1293
+ ///
1294
+ open func updatePhoneSession(
1295
+ userId: String ,
1296
+ secret: String
1297
+ ) async throws -> AppwriteModels . Session {
1298
+ let apiPath : String = " /account/sessions/phone "
1299
+
1300
+ let apiParams : [ String : Any ? ] = [
1301
+ " userId " : userId,
1302
+ " secret " : secret
1303
+ ]
1304
+
1305
+ let apiHeaders : [ String : String ] = [
1306
+ " content-type " : " application/json "
1307
+ ]
1308
+
1309
+ let converter : ( Any ) -> AppwriteModels . Session = { response in
1310
+ return AppwriteModels . Session. from ( map: response as! [ String : Any ] )
1311
+ }
1312
+
1313
+ return try await client. call (
1314
+ method: " PUT " ,
1315
+ path: apiPath,
1316
+ headers: apiHeaders,
1317
+ params: apiParams,
1318
+ converter: converter
1319
+ )
1320
+ }
1321
+
1257
1322
///
1258
1323
/// Create session
1259
1324
///
@@ -1330,7 +1395,7 @@ open class Account: Service {
1330
1395
}
1331
1396
1332
1397
///
1333
- /// Update (or renew) a session
1398
+ /// Update (or renew) session
1334
1399
///
1335
1400
/// Extend session's expiry to increase it's lifespan. Extending a session is
1336
1401
/// useful when session length is short such as 5 minutes.
@@ -1448,7 +1513,7 @@ open class Account: Service {
1448
1513
}
1449
1514
1450
1515
///
1451
- /// Create a push target
1516
+ /// Create push target
1452
1517
///
1453
1518
/// @param String targetId
1454
1519
/// @param String identifier
@@ -1487,7 +1552,7 @@ open class Account: Service {
1487
1552
}
1488
1553
1489
1554
///
1490
- /// Update a push target
1555
+ /// Update push target
1491
1556
///
1492
1557
/// @param String targetId
1493
1558
/// @param String identifier
@@ -1523,7 +1588,7 @@ open class Account: Service {
1523
1588
}
1524
1589
1525
1590
///
1526
- /// Delete a push target
1591
+ /// Delete push target
1527
1592
///
1528
1593
/// @param String targetId
1529
1594
/// @throws Exception
0 commit comments