Skip to content

Commit

Permalink
feat: remove nanoid dependency and use UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
lauramargar committed Jan 24, 2024
1 parent 9cd94f7 commit 8340c67
Show file tree
Hide file tree
Showing 3 changed files with 3,012 additions and 8,126 deletions.
1 change: 0 additions & 1 deletion packages/x-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
},
"dependencies": {
"@empathyco/x-storage-service": "^2.0.3-alpha.0",
"nanoid": "~3.3.0",
"tslib": "~2.6.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/x-utils/src/services/session.service.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { nanoid } from 'nanoid';
import {
BrowserStorageService,
InMemoryStorageService,
Expand Down Expand Up @@ -39,7 +38,8 @@ export class DefaultSessionService implements SessionService {
* @public
*/
getSessionId(): string {
const sessionId = this.storageService.getItem(DefaultSessionService.SESSION_ID_KEY) ?? nanoid();
const sessionId =
this.storageService.getItem(DefaultSessionService.SESSION_ID_KEY) ?? self.crypto.randomUUID();
this.storageService.setItem(DefaultSessionService.SESSION_ID_KEY, sessionId, this.ttlMs);
return sessionId;
}
Expand Down
Loading

0 comments on commit 8340c67

Please sign in to comment.