Skip to content

Commit

Permalink
Undo breaking change
Browse files Browse the repository at this point in the history
  • Loading branch information
tedspare committed Jan 6, 2025
1 parent 74279f2 commit 86439df
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -73,7 +73,7 @@ export function createAuthActions({
user
})

if (!success && protectedRoute) {
if (!success) {
redirect(unauthorizedUrl)
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "*",
Expand Down

0 comments on commit 86439df

Please sign in to comment.