AuthCategoryUserBehavior
public protocol AuthCategoryUserBehavior : AnyObject
-
Returns the currently logged in user.
Declaration
Swift
func getCurrentUser() -> AuthUser?
-
Fetch user attributes for the current user.
Declaration
Swift
@discardableResult func fetchUserAttributes(options: AuthFetchUserAttributeOperation.Request.Options?, listener: AuthFetchUserAttributeOperation.ResultListener?) -> AuthFetchUserAttributeOperation
Parameters
options
Parameters specific to plugin behavior
listener
Triggered when the operation completes.
-
Update user attribute for the current user
Declaration
Swift
@discardableResult func update(userAttribute: AuthUserAttribute, options: AuthUpdateUserAttributeOperation.Request.Options?, listener: AuthUpdateUserAttributeOperation.ResultListener?) -> AuthUpdateUserAttributeOperation
Parameters
userAttribute
Attribute that need to be updated
options
Parameters specific to plugin behavior
listener
Triggered when the operation completes.
-
Update a list of user attributes for the current user
Declaration
Swift
@discardableResult func update(userAttributes: [AuthUserAttribute], options: AuthUpdateUserAttributesOperation.Request.Options?, listener: AuthUpdateUserAttributesOperation.ResultListener?) -> AuthUpdateUserAttributesOperation
Parameters
userAttributes
List of attribtues that need ot be updated
options
Parameters specific to plugin behavior
listener
Triggered when the operation completes.
-
Resends the confirmation code required to verify an attribute
Declaration
Swift
@discardableResult func resendConfirmationCode(for attributeKey: AuthUserAttributeKey, options: AuthAttributeResendConfirmationCodeOperation.Request.Options?, listener: AuthAttributeResendConfirmationCodeOperation.ResultListener?) -> AuthAttributeResendConfirmationCodeOperation
Parameters
attributeKey
Attribute to be verified
options
Parameters specific to plugin behavior
listener
Triggered when the operation completes.
-
Confirm an attribute using confirmation code
Declaration
Swift
@discardableResult func confirm(userAttribute: AuthUserAttributeKey, confirmationCode: String, options: AuthConfirmUserAttributeOperation.Request.Options?, listener: AuthConfirmUserAttributeOperation.ResultListener?) -> AuthConfirmUserAttributeOperation
Parameters
userAttribute
Attribute to verify
confirmationCode
Confirmation code received
options
Parameters specific to plugin behavior
listener
Triggered when the operation completes.
-
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
@discardableResult func update(oldPassword: String, to newPassword: String, options: AuthChangePasswordOperation.Request.Options?, listener: AuthChangePasswordOperation.ResultListener?) -> AuthChangePasswordOperation
Parameters
oldPassword
Current password of the user
newPassword
New password to be updated
options
Parameters specific to plugin behavior
listener
Triggered when the operation completes.
-
fetchUserAttributes(options:
Extension method) Fetch user attributes for the current user.
Declaration
Swift
func fetchUserAttributes( options: AuthFetchUserAttributeOperation.Request.Options? = nil ) -> AuthFetchUserAttributeOperation
Parameters
options
Parameters specific to plugin behavior
-
update(userAttribute:
Extension methodoptions: ) Update user attribute for the current user
Declaration
Swift
func update( userAttribute: AuthUserAttribute, options: AuthUpdateUserAttributeOperation.Request.Options? = nil ) -> AuthUpdateUserAttributeOperation
Parameters
userAttribute
Attribute that need to be updated
options
Parameters specific to plugin behavior
-
update(userAttributes:
Extension methodoptions: ) Update a list of user attributes for the current user
Declaration
Swift
func update( userAttributes: [AuthUserAttribute], options: AuthUpdateUserAttributesOperation.Request.Options? = nil ) -> AuthUpdateUserAttributesOperation
Parameters
userAttributes
List of attribtues that need ot be updated
options
Parameters specific to plugin behavior
-
resendConfirmationCode(for:
Extension methodoptions: ) Resends the confirmation code required to verify an attribute
Declaration
Swift
func resendConfirmationCode( for attributeKey: AuthUserAttributeKey, options: AuthAttributeResendConfirmationCodeOperation.Request.Options? = nil ) -> AuthAttributeResendConfirmationCodeOperation
Parameters
attributeKey
Attribute to be verified
options
Parameters specific to plugin behavior
-
confirm(userAttribute:
Extension methodconfirmationCode: options: ) Confirm an attribute using confirmation code
Declaration
Swift
func confirm( userAttribute: AuthUserAttributeKey, confirmationCode: String, options: AuthConfirmUserAttributeOperation.Request.Options? = nil ) -> AuthConfirmUserAttributeOperation
Parameters
userAttribute
Attribute to verify
confirmationCode
Confirmation code received
options
Parameters specific to plugin behavior
-
update(oldPassword:
Extension methodto: 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: AuthChangePasswordOperation.Request.Options? = nil ) -> AuthChangePasswordOperation
Parameters
oldPassword
Current password of the user
newPassword
New password to be updated
options
Parameters specific to plugin behavior