diff --git a/package.json b/package.json index 668e40d..5852f1d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@chatenium/chatenium-sdk", - "version": "1.0.5", + "version": "1.0.6", "description": "A library for interacting with the Chatenium API", "type": "module", "main": "dist/index.js", diff --git a/src/services/sessionManager.ts b/src/services/sessionManager.ts index 83a8e60..ec6220b 100644 --- a/src/services/sessionManager.ts +++ b/src/services/sessionManager.ts @@ -36,8 +36,9 @@ export class SessionManager { async loadSessions(): Promise { const tokens = await this.keyring.getAll() const sessions: Session[] = [] - for (const token of tokens) { - const userData = await this.database.get("sessions", token.split(".")[0]) + for (const tokenKey of tokens) { + const token = await this.keyring.get(tokenKey) + const userData = await this.database.get("sessions", tokenKey) if (userData) { sessions.push({ token: token,