secure-ls
secure-ls copied to clipboard
need secure-ls support sessionStorage
Hi Varun Malhotra, do you have any planning to let secure-ls support sessionStorage?
From other fork, someone already tried it: https://github.com/hansanwok/secure-ls/pull/2 It may need to pull request here too.
i need it too. will you merge it? if not, would you mind explaining me how i can install the version with the PR integrated via npm? i've never done this before
any news about this?
A hacky TS solution
export class SecureStorage extends SecureLS {
constructor(config: { isCompression?: boolean, encodingType?: string, encryptionSecret?: string, encryptionNamespace?: string, useSessionStore?: boolean }) {
super(config);
// tslint:disable-next-line:ban-ts-ignore
// @ts-ignore
super.ls = config.useSessionStore ? sessionStorage : localStorage;
}
}