From 86439dfcb14a4ab0744d4d1617291e5772cb2e51 Mon Sep 17 00:00:00 2001 From: tedspare Date: Mon, 6 Jan 2025 11:47:08 -0500 Subject: [PATCH] Undo breaking change --- CHANGELOG.md | 1 + lib/utils.ts | 4 ++-- package.json | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c2e4b5..e226500 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +- [2025-01-06] [Undo breaking change](https://github.com/RubricLab/auth/commit/7f85ee885e6b66a2eecb84da32b36a5f4ea02160) - [2025-01-06] [Add protectRoute arg to getSession](https://github.com/RubricLab/auth/commit/76aa6c4df2d26fba87df6a89327991fcef06afb7) - [2024-10-31] [next auth 15 support awaited cookies](https://github.com/RubricLab/auth/commit/8444c6e86d48c4ab7b180e2001ad1fd713a6684d) - [2024-10-24] [add notify-monorepo action](https://github.com/RubricLab/auth/commit/d111b1ebaca5f3599f8477a5c61e15db60d86238) diff --git a/lib/utils.ts b/lib/utils.ts index f96ff75..94a43df 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -63,7 +63,7 @@ export function createAuthActions({ }) }, - async getSession({ protectedRoute = true }: { protectedRoute?: boolean } = {}) { + async getSession() { const user = JSON.parse((await cookies()).get('user')?.value || '{}') const sessionKey = (await cookies()).get('key')?.value @@ -73,7 +73,7 @@ export function createAuthActions({ user }) - if (!success && protectedRoute) { + if (!success) { redirect(unauthorizedUrl) } diff --git a/package.json b/package.json index 6cdaff7..b120561 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "lint:fix": "bun x biome check --fix --unsafe . && bun x biome lint --write --unsafe ." }, "name": "@rubriclab/auth", - "version": "0.0.11", + "version": "0.0.12", "main": "index.ts", "dependencies": { "@rubriclab/package": "*",