1. Get Session
The OTPless JavaScript SDK provides theOTPlessVerifySession method to retrieve the current session state. This method helps check whether the user is logged in and returns an in-memory session object if the session is active.
Usage
Behavior
a. If Logged In: Returns the in-memory session object containing details of the active session.success: false.
2. Revoke Session
The SDK provides a method to log out a user by revoking their current session. This wraps the OTPless Revoke Session endpoint.Usage
Behavior
- Clears the user and session objects from local storage.
- If the SDK cannot contact the OTPless servers, it retains the local session state for recovery or retry.