Skip to content

Commit

Permalink
Updating server while researching middleware
Browse files Browse the repository at this point in the history
  • Loading branch information
iamhectorsosa committed Apr 9, 2024
1 parent c3597ba commit c312a5a
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions apps/next/modules/utils/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,18 @@ export function createClient(): ReturnType<
return cookieStore.get(name)?.value
},
set(name: string, value: string, options: CookieOptions) {
cookieStore.set({ name, value, ...options })
try {
cookieStore.set({ name, value, ...options })
} catch (error) {
console.error(error)
}
},
remove(name: string, options: CookieOptions) {
cookieStore.set({ name, value: "", ...options })
try {
cookieStore.set({ name, value: "", ...options })
} catch (error) {
console.error(error)
}
},
},
}
Expand Down

0 comments on commit c312a5a

Please sign in to comment.