-
Notifications
You must be signed in to change notification settings - Fork 310
Description
What version of Stacks.js are you using?
@stacks/auth: 7.0.2
Describe the bug
When a new instance of the UserSession class is trying to be created, in an Expo environment and without a valid second parameter for a sessionStore, the code in the constructor assumes that it is running in the browser and defaults to create an instance of LocalStorageStore rather than InstanceDataStore which leads to an error.
The class InstanceDataStore is not provided by the library
How to reproduce
import { AppConfig, UserSession } from '@stacks/auth';
const appConfig = new AppConfig(['store_write']);
const userSession = new UserSession({ appConfig });
Expected behavior
Code should correctly detect the mobile environment and/or perhaps provide access to InstanceDataStore
Additional context
- Desktop/Smartphone OS: Android 15
https://github.com/hirosystems/stacks.js/blob/main/packages/auth/src/userSession.ts#L60