You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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
https://github.com/hirosystems/stacks.js/blob/main/packages/auth/src/userSession.ts#L60
The text was updated successfully, but these errors were encountered: