44/// - ``MyAccount``
55/// - ``MyAccountError``
66public protocol MyAccountAuthenticationMethods : MyAccountClient {
7-
7+
88#if PASSKEYS_PLATFORM
99 /// Requests a challenge for enrolling a new passkey. This is the first part of the enrollment flow.
1010 ///
@@ -75,7 +75,7 @@ public protocol MyAccountAuthenticationMethods: MyAccountClient {
7575 @available ( iOS 16 . 6 , macOS 13 . 5 , visionOS 1 . 0 , * )
7676 func passkeyEnrollmentChallenge( userIdentityId: String ? ,
7777 connection: String ? ) -> Request < PasskeyEnrollmentChallenge , MyAccountError >
78-
78+
7979 /// Enrolls a new passkey credential. This is the last part of the enrollment flow.
8080 ///
8181 /// ## Availability
@@ -184,7 +184,7 @@ public protocol MyAccountAuthenticationMethods: MyAccountClient {
184184 /// - authSession: The unique session identifier for the enrollment as returned by POST /authentication-methods
185185 /// - Returns: A request that will yield an enrolled recovery code authentication method.
186186 func confirmRecoveryCodeEnrollment( id: String ,
187- authSession: String ) -> Request < AuthenticationMethod , MyAccountError >
187+ authSession: String ) -> Request < AuthenticationMethod , MyAccountError >
188188
189189 /// Requests a challenge for enrolling a TOTP authentication method. This is the first part of the enrollment flow.
190190 ///
@@ -394,8 +394,8 @@ public protocol MyAccountAuthenticationMethods: MyAccountClient {
394394 /// - otpCode: The one-time password code sent to the email address.
395395 /// - Returns: A request that will yield an enrolled email authentication method.
396396 func confirmEmailEnrollment( id: String ,
397- authSession: String ,
398- otpCode: String ) -> Request < AuthenticationMethod , MyAccountError >
397+ authSession: String ,
398+ otpCode: String ) -> Request < AuthenticationMethod , MyAccountError >
399399
400400 /// Requests a challenge for enrolling a Phone authentication method. This is the first part of the enrollment flow.
401401 ///
@@ -471,7 +471,7 @@ public protocol MyAccountAuthenticationMethods: MyAccountClient {
471471 authSession: String ,
472472 otpCode: String ) -> Request < AuthenticationMethod , MyAccountError >
473473
474- /// Retrieve detailed list of authentication methods belonging to the authenticated user.
474+ /// Delete an authentication method associated with an id
475475 ///
476476 /// ## Availability
477477 ///
@@ -481,29 +481,31 @@ public protocol MyAccountAuthenticationMethods: MyAccountClient {
481481 ///
482482 /// ## Scopes Required
483483 ///
484- /// `read :me:authentication_methods`
484+ /// `delete :me:authentication_methods`
485485 ///
486486 /// ## Usage
487487 ///
488488 /// ```swift
489489 /// Auth0
490490 /// .myAccount(token: apiCredentials.accessToken)
491491 /// .authenticationMethods
492- /// .getAuthenticationMethods( )
492+ /// .deleteAuthenticationMethod(by: id )
493493 /// .start { result in
494494 /// switch result {
495- /// case .success(let authenticationMethods) :
496- /// print("List of Authentication methods: \(authenticationMethods) ")
495+ /// case .success:
496+ /// print("Authentication method is deleted ")
497497 /// case .failure(let error):
498498 /// print("Failed with: \(error)")
499499 /// }
500500 /// }
501501 /// ```
502502 ///
503- /// - Returns: A request that will return list of authentication methods of an authenticated user
504- func getAuthenticationMethods( ) -> Request < [ AuthenticationMethod ] , MyAccountError >
503+ /// - Parameters:
504+ /// - id: Id of the authentication method user wishes to delete
505+ /// - Returns: A request that will delete an authentication method associated with an id
506+ func deleteAuthenticationMethod( by id: String ) -> Request < Void , MyAccountError >
505507
506- /// Delete an authentication method associated with an id
508+ /// Fetch details of an authentication method associated with an id
507509 ///
508510 /// ## Availability
509511 ///
@@ -513,31 +515,31 @@ public protocol MyAccountAuthenticationMethods: MyAccountClient {
513515 ///
514516 /// ## Scopes Required
515517 ///
516- /// `delete :me:authentication_methods`
518+ /// `read :me:authentication_methods`
517519 ///
518520 /// ## Usage
519521 ///
520522 /// ```swift
521523 /// Auth0
522524 /// .myAccount(token: apiCredentials.accessToken)
523525 /// .authenticationMethods
524- /// .deleteAuthenticationMethod (by: id)
526+ /// .getAuthenticationMethod (by: id)
525527 /// .start { result in
526528 /// switch result {
527- /// case .success:
528- /// print("Authentication method is deleted ")
529+ /// case .success(let authenticationMethod) :
530+ /// print("Fetched authentication method: \(authenticationMethod) ")
529531 /// case .failure(let error):
530532 /// print("Failed with: \(error)")
531533 /// }
532534 /// }
533535 /// ```
534536 ///
535537 /// - Parameters:
536- /// - id: Id of the authentication method user wishes to delete
537- /// - Returns: A request that will delete an authentication method associated with an id
538- func deleteAuthenticationMethod ( by id: String ) -> Request < Void , MyAccountError >
538+ /// - id: Id of the returned authentication method
539+ /// - Returns: A request to fetch authentication method associated with the id.
540+ func getAuthenticationMethod ( by id: String ) -> Request < AuthenticationMethod , MyAccountError >
539541
540- /// Fetch details of an authentication method associated with an id
542+ /// Retrieve detailed list of authentication methods belonging to the authenticated user.
541543 ///
542544 /// ## Availability
543545 ///
@@ -555,21 +557,19 @@ public protocol MyAccountAuthenticationMethods: MyAccountClient {
555557 /// Auth0
556558 /// .myAccount(token: apiCredentials.accessToken)
557559 /// .authenticationMethods
558- /// .getAuthenticationMethod(by: id )
560+ /// .getAuthenticationMethods( )
559561 /// .start { result in
560562 /// switch result {
561- /// case .success(let authenticationMethod ):
562- /// print("Fetched authentication method : \(authenticationMethod )")
563+ /// case .success(let authenticationMethods ):
564+ /// print("List of Authentication methods : \(authenticationMethods )")
563565 /// case .failure(let error):
564566 /// print("Failed with: \(error)")
565567 /// }
566568 /// }
567569 /// ```
568570 ///
569- /// - Parameters:
570- /// - id: Id of the returned authentication method
571- /// - Returns: A request to fetch authentication method associated with the id.
572- func getAuthenticationMethod( by id: String ) -> Request < AuthenticationMethod , MyAccountError >
571+ /// - Returns: A request that will return list of authentication methods of an authenticated user
572+ func getAuthenticationMethods( ) -> Request < [ AuthenticationMethod ] , MyAccountError >
573573
574574 /// List of factors enabled for the Auth0 tenant and available for enrollment by this user.
575575 ///
0 commit comments