
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
svelte-session-manager
Advanced tools
Session store for svelte (currently only for JWT)
import { derived } from 'svelte';
import { Session, login } from 'svelte-session-manager';
// use localStorage as backing store
let session = new Session(localStorage);
// session may still be valid
if(!session.isValid) {
await login(session, 'https://mydomain.com/authenticate', 'a user', 'a secret');
}
session.isValid; // true when auth was ok or localStorage token is still valid
export const values = derived(
session,
($session, set) => {
if (!session.isValid) {
set([]); // session has expired no more data
} else {
fetch('https://mydomain.com/values', {
headers: {
...session.authorizationHeader
}
}).then(async data => set(await data.json()));
}
return () => {};
}
,[]);
// $values contains fetch result as long as session has not expired
export BROWSER=safari|chrome|...
npm|yarn test
Data as preserved in the backing store
Type: Object
User session To create as session backed by browser local storage
let session = new Session(localStorage);
or session storage
let session = new Session(sessionStorage);
data
SessionDataentitlements
Set<string>subscriptions
Set<Object> store subscriptionsexpirationDate
Datestore
SessionData backing store to use for save same as data parampersist into the packing store
http header suitable for fetch
Returns Object header The http header.
Returns string header.Authorization The Bearer access token.
As long as the expirationTimer is running we must be valid
Returns boolean true if session is valid (not expired)
remove all tokens from the session and the backing store
Fired when the session changes
subscription
FunctionBring session into the valid state by calling the authorization endpoint and asking for a access_token. Executess a POST on the endpoint url providing username, and password as json
session
Session to be openedendpoint
string authorization urlusername
string id of the userpassword
string user credentialsWith npm do:
npm install svelte-session-manager
BSD-2-Clause
FAQs
Session store for svelte (currently only for JWT)
The npm package svelte-session-manager receives a total of 69 weekly downloads. As such, svelte-session-manager popularity was classified as not popular.
We found that svelte-session-manager demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.