AuthCategoryUserBehavior
public protocol AuthCategoryUserBehavior : AnyObject
-
getCurrentUser()
AsynchronousReturns the currently logged in user.
Declaration
Swift
func getCurrentUser() async throws -> AuthUser
-
fetchUserAttributes(options:
Asynchronous) Fetch user attributes for the current user.
Declaration
Swift
func fetchUserAttributes( options: AuthFetchUserAttributesRequest.Options? ) async throws -> [AuthUserAttribute]
Parameters
options
Parameters specific to plugin behavior
-
update(userAttribute:
Asynchronousoptions: ) Update user attribute for the current user
Declaration
Swift
func update( userAttribute: AuthUserAttribute, options: AuthUpdateUserAttributeRequest.Options? ) async throws -> AuthUpdateAttributeResult
Parameters
userAttribute
Attribute that need to be updated
options
Parameters specific to plugin behavior
-
update(userAttributes:
Asynchronousoptions: ) Update a list of user attributes for the current user
Declaration
Swift
func update( userAttributes: [AuthUserAttribute], options: AuthUpdateUserAttributesRequest.Options? ) async throws -> [AuthUserAttributeKey: AuthUpdateAttributeResult]
Parameters
userAttributes
List of attribtues that need ot be updated
options
Parameters specific to plugin behavior
-
resendConfirmationCode(forUserAttributeKey:
Asynchronousoptions: ) Resends the confirmation code required to verify an attribute
Declaration
Swift
@available(*, deprecated, renamed: "sendVerificationCode(forUserAttributeKey:options:﹚") func resendConfirmationCode( forUserAttributeKey userAttributeKey: AuthUserAttributeKey, options: AuthAttributeResendConfirmationCodeRequest.Options? ) async throws -> AuthCodeDeliveryDetails
Parameters
userAttributeKey
Attribute to be verified
options
Parameters specific to plugin behavior
-
sendVerificationCode(forUserAttributeKey:
Asynchronousoptions: ) Sends the verification code required to verify an attribute
Declaration
Swift
func sendVerificationCode( forUserAttributeKey userAttributeKey: AuthUserAttributeKey, options: AuthSendUserAttributeVerificationCodeRequest.Options? ) async throws -> AuthCodeDeliveryDetails
Parameters
userAttributeKey
Attribute to be verified
options
Parameters specific to plugin behavior
-
confirm(userAttribute:
AsynchronousconfirmationCode: options: ) Confirm an attribute using confirmation code
Declaration
Swift
func confirm( userAttribute: AuthUserAttributeKey, confirmationCode: String, options: AuthConfirmUserAttributeRequest.Options? ) async throws
Parameters
userAttribute
Attribute to verify
confirmationCode
Confirmation code received
options
Parameters specific to plugin behavior
-
update(oldPassword:
Asynchronousto: options: ) Update the current logged in user’s password
Check the plugins documentation, you might need to re-authenticate the user after calling this method.
Declaration
Swift
func update( oldPassword: String, to newPassword: String, options: AuthChangePasswordRequest.Options? ) async throws
Parameters
oldPassword
Current password of the user
newPassword
New password to be updated
options
Parameters specific to plugin behavior