AuthManager that authenticates users via email OTP.
OTP flow
Initializers
init(apiKey:)
init(authService:secureStorage:)
Instance Properties
Instance Methods
confirmEmailOtp(email:code:)
Validates the OTP code and, on success, establishes an authenticated session.Discussion
Must be called aftersendEmailOtp(email:) with the same email address. Throws AuthManagerError.noPendingOTP if no email has been sent yet.
logout()
Invalidates the server-side refresh token and clears the local session.Discussion
Has no effect if the user is not currently authenticated.oneTimeSecretAuthentication(oneTimeSecret:)
reset()
Clears the local session state without contacting the server.Discussion
Use this when the server session is already gone (e.g. the refresh token expired or was revoked externally) and you just need to reset local state. Preferlogout() when the session is still valid and you want to revoke the server-side token as well.
sendEmailOtp(email:)
Sends a one-time password to the given email address. CallconfirmEmailOtp(email:code:) next.
setJWT(_:)
Inherited fromAuthManager.setJWT(_:).

