CombineWrapper
public final class CombineWrapper : WebcomWrapper, CustomDebugStringConvertible
The type that wraps AuthenticationMethodInternal
in order to enrich it with a Combine-based API.
See also the documentation section of WebcomWrapper
for the corresponding wrapped type.
To use this type, import the following dependency in your code:
import WebcomCombine
-
Declaration
Swift
public let wrapped: AuthenticationMethodInternal
-
Requests to send a link to the user, which allows him/her to reset his/her password.
Only use this method if the authentication mode is
Mode.staticPassword
.Declaration
Swift
public func requestPasswordResetLink() -> WebcomFuture<Void>
Return Value
A future with a void value.
-
requestPasswordResetLink(session:
Asynchronous) Declaration
Swift
public func requestPasswordResetLink(session: URLSession? = nil) async throws
-
Updates the password of the user.
This method may only by used:
- if the authentication mode is
Mode.staticPassword
, - and the
setStaticPassword(_:)
method has been called before.
After using this method, you may safely continue the authentication process using the
AuthenticationService.continueAuthentication()
method.Declaration
Swift
public func updatePassword(to newPassword: String) -> WebcomFuture<Void>
Parameters
newPassword
The new password of the user.
Return Value
A future with a void value.
- if the authentication mode is
-
updatePassword(to:
Asynchronous) Declaration
Swift
public func updatePassword(to newPassword: String) async throws
-
Attach a new identity to the current user.
This method is to be used only for sign-up.
To sign-in, use the
setVerificationOneTimePassword(_:)
method when the authentication mode isMode.oneTimePassword
or directly theAuthenticationService.continueAuthentication()
method when the authentication mode isMode.staticPassword
.Declaration
Swift
public func attachIdentity() -> WebcomFuture<Void>
Return Value
A future with a void value.
-
attachIdentity()
AsynchronousDeclaration
Swift
public func attachIdentity() async throws
-
Requests the verification token again.
The verification token was normally sent to the user at sign-up. This method may be used to send it again, if the user has not received it or if he/she has lost it. Only use this method if the authentication mode is
Mode.staticPassword
.Declaration
Swift
public func requestVerificationTokenAgain() -> WebcomFuture<Void>
Return Value
A future with a void value.
-
requestVerificationTokenAgain()
AsynchronousDeclaration
Swift
public func requestVerificationTokenAgain() async throws
-
Requests the provider to send a one-time password for sign-in.
For sign-up, use the
attachIdentity()
method instead.For security reasons, this method returns a succeeding future when the user has not yet signed-up, but it does nothing in this case.
Declaration
Swift
public func requestOneTimePassword() -> WebcomFuture<Void>
Return Value
A future with a void value.
-
requestOneTimePassword()
AsynchronousDeclaration
Swift
public func requestOneTimePassword() async throws
-
Processed an operation on the user profile.
Important: This method does not trigger any authentication event. The updated profile will only be available the next time the same user will sign in. The user profile is not designed to store business applicative data about the user. For that purpose, use the
DatasyncService
.Declaration
Swift
public func processProfileOperation(_ operation: ProfileOperation) -> WebcomFuture<Void>
Parameters
operation
The operation to process.
Return Value
A future with a void value.
-
processProfileOperation(_:
Asynchronous) Declaration
Swift
public func processProfileOperation(_ operation: ProfileOperation) async throws