Skip to content

Commit

Permalink
Forbid 'session' as sessionName in StoreSession.ts (#704)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubk authored Aug 7, 2024
1 parent a9fdc26 commit d955426
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions gramjs/sessions/StoreSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ export class StoreSession extends MemorySession {

constructor(sessionName: string, divider = ":") {
super();
if (sessionName === "session") {
throw new Error("Session name can't be 'session'. Please use a different name.");
}
if (typeof localStorage === "undefined" || localStorage === null) {
const LocalStorage = require("./localStorage").LocalStorage;
this.store = store.area(
Expand Down

0 comments on commit d955426

Please sign in to comment.