secure-ls icon indicating copy to clipboard operation
secure-ls copied to clipboard

need secure-ls support sessionStorage

Open ayun2001 opened this issue 5 years ago • 4 comments

Hi Varun Malhotra, do you have any planning to let secure-ls support sessionStorage?

ayun2001 avatar Nov 20 '19 08:11 ayun2001

From other fork, someone already tried it: https://github.com/hansanwok/secure-ls/pull/2 It may need to pull request here too.

YanDevDe avatar Dec 24 '19 11:12 YanDevDe

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

GsHeri avatar Jan 23 '20 14:01 GsHeri

any news about this?

ghost avatar Jul 28 '20 17:07 ghost

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;
	}
}

gilbertg avatar Mar 17 '22 08:03 gilbertg