The Session Management feature in Auth + Embedded Wallet simplifies account management, authentication, and session control for your application.
isSessionValid method. This returns true for email login and trusted social logins and false for custom logins until email validation is complete.
validateSession method. This will send a code to the user’s email. If validated within 10 minutes, the method returns true; otherwise, it returns false.
finishValidateSession method that takes the code as an argument. If the code is valid, the method returns true; otherwise, it returns false.
onValidationRequired callback is used to determine the need for session validation during actions like sending transactions or signing messages. If the callback returns true, it triggers session validation. If it returns false, the related action is cancelled. This mechanism ensures that only validated sessions can proceed with sensitive operations.
onValidationRequired hook to catch such instances.
true or false from the onValidationRequired hook, you either continue or cancel the action, respectively.
id of the session. Any session can be closed from any device with an active session.