Skip to content

Commit

Permalink
add support for sveltekit 2 (#712)
Browse files Browse the repository at this point in the history
* add support for sveltekit 2

* Update package.json to peerDependency v1 or v2
  • Loading branch information
wbhob authored Jan 17, 2024
1 parent 201e6d6 commit dee94aa
Show file tree
Hide file tree
Showing 4 changed files with 604 additions and 42 deletions.
5 changes: 5 additions & 0 deletions .changeset/empty-oranges-hug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@supabase/auth-helpers-sveltekit': minor
---

add support for sveltekit 2
11 changes: 6 additions & 5 deletions packages/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,21 @@
"homepage": "https://github.com/supabase/auth-helpers/tree/main/packages/sveltekit#readme",
"devDependencies": {
"@supabase/supabase-js": "2.19.0",
"@sveltejs/kit": "1.15.4",
"@sveltejs/kit": "^2.0.0",
"@sveltejs/vite-plugin-svelte": "^3.0.0",
"rimraf": "^4.4.1",
"svelte": "^3.59.2",
"svelte": "^4.0.0",
"tsconfig": "workspace:*",
"tslib": "^2.6.2",
"tsup": "^6.7.0",
"typescript": "^4.9.5",
"vite": "^4.4.9"
"typescript": "^5.0.0",
"vite": "^5.0.0"
},
"dependencies": {
"@supabase/auth-helpers-shared": "workspace:*"
},
"peerDependencies": {
"@supabase/supabase-js": "^2.19.0",
"@sveltejs/kit": "^1.15.4"
"@sveltejs/kit": "^1.15.4 || ^2.0.0"
}
}
2 changes: 2 additions & 0 deletions packages/sveltekit/src/serverStorageAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ export class SvelteKitServerAuthStorageAdapter extends CookieAuthStorageAdapter
protected setCookie(name: string, value: string) {
this.event.cookies.set(name, value, {
httpOnly: false,
path: '/',
...this.cookieOptions
});
}

protected deleteCookie(name: string) {
this.event.cookies.delete(name, {
httpOnly: false,
path: '/',
...this.cookieOptions
});
}
Expand Down
Loading

0 comments on commit dee94aa

Please sign in to comment.