New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

svelte-kit-sessions

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svelte-kit-sessions - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

dist/index.d.ts

@@ -137,2 +137,2 @@ import type { Handle } from '@sveltejs/kit';

declare const sveltekitSessionHandle: (options: SveltekitSessionConfig) => Handle;
export { sveltekitSessionHandle, MemoryStore };
export { sveltekitSessionHandle, MemoryStore, Session };

@@ -10,2 +10,2 @@ import Session from './session.js';

};
export { sveltekitSessionHandle, MemoryStore };
export { sveltekitSessionHandle, MemoryStore, Session };
{
"name": "svelte-kit-sessions",
"description": "A easy and efficient session management in SvelteKit",
"version": "0.0.5",
"version": "0.0.6",
"author": "yutak23 <yuta.katayama.23+github@gmail.com> (https://github.com/yutak23)",

@@ -6,0 +6,0 @@ "repository": {

@@ -64,7 +64,6 @@ # svelte-kit-sessions

import type { ServerLoad, Actions } from '@sveltejs/kit';
import type Session from 'svelte-kit-sessions';
import db from '$lib/server/db.ts';
export const load: ServerLoad = async ({ locals }) => {
const session: Session = locals; // you can access `locals.session`
const { session } = locals; // you can access `locals.session`
const user = await db.getUserFromId(session.data.userId);

@@ -76,3 +75,3 @@ return { user };

login: async ({ request, locals }) => {
const session: Session = locals; // you can access `locals.session`
const { session } = locals; // you can access `locals.session`

@@ -84,3 +83,3 @@ const data = await request.formData();

await session.setData({ id: user.id, name: user.name }); // set data to session
await session.setData({ userId: user.id, name: user.name }); // set data to session
await session.save(); // session saveand session create(session data is stored and set-cookie)

@@ -99,3 +98,2 @@

import { json, type RequestEvent, type RequestHandler } from '@sveltejs/kit';
import type Session from 'svelte-kit-sessions';
import db from '$lib/server/db.ts';

@@ -109,3 +107,3 @@

export const POST: RequestHandler = async (event: RequestEvent) => {
const session: Session = event.locals; // you can access `locals.session`
const { session } = locals; // you can access `locals.session`

@@ -112,0 +110,0 @@ const { title, memo } = (await event.request.json()) as TodoBody;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc