Authentication & User Account
How OnsideKit handles authentication: explicit and on-demand login, the two login flows, reading session state, and logging out.
How login is triggered
Explicit login
@MainActor static func requestLogin(
completion: (@MainActor (Result<Void, OnsideLoginError>) -> Void)? = nil
)Onside.requestLogin { result in
switch result {
case .success:
// The user is now logged in.
updateUI()
case .failure(.loginDiscarded):
// The user dismissed the login screen.
break
}
}Implicit (on-demand) login
The two login flows
Reading the session state
Check the current status
Observe changes
Logging out
Authentication, region, and pricing
Last updated
Was this helpful?