Skip to content

Commit 0831bae

Browse files
docs: Update out of date mentions of getUser (supabase#40045)
1 parent cf6ddae commit 0831bae

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

apps/docs/content/guides/auth/server-side/advanced-guide.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ When you receive this error on the server-side, try to defer rendering to the br
5050

5151
The `Max-Age` or `Expires` cookie parameters only control whether the browser sends the value to the server. Since a refresh token represents the long-lived authentication session of the user on that browser, setting a short `Max-Age` or `Expires` parameter on the cookies only results in a degraded user experience.
5252

53-
The only way to ensure that a user has logged out or their session has ended is to get the user's details with `getUser()`.
53+
The only way to ensure that a user has logged out or their session has ended is to get the user's details with `getUser()`. The `getClaims()` method only checks local JWT validation (signature and expiration), but it doesn't verify with the auth server whether the session is still valid or if the user has logged out server-side.
5454

5555
### What should I use for the `SameSite` property?
5656

apps/docs/content/guides/functions/websockets.mdx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ Deno.serve((req) => {
155155
return new Response('Auth token not provided', { status: 403 })
156156
}
157157

158-
const { error, data } = await supabase.auth.getUser(jwt)
158+
const { error, data } = await supabase.auth.getClaims()
159159

160160
if (error) {
161161
console.error(error)
@@ -210,8 +210,7 @@ Deno.serve((req) => {
210210
return new Response('Auth token not provided', { status: 403 })
211211
}
212212

213-
const { error, data } = await supabase.auth.getUser(jwt)
214-
213+
const { error, data } = await supabase.auth.getClaims()
215214
if (error) {
216215
console.error(error)
217216
return new Response('Invalid token provided', { status: 403 })

apps/docs/content/troubleshooting/should-i-set-a-shorter-max-age-parameter-on-the-cookies-8sbF4V.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ database_id = "e51bedf0-cdc4-4880-865b-e39c06dfe497"
99

1010
The `Max-Age` or `Expires` cookie parameters only control whether the browser sends the value to the server. Since a refresh token represents the long-lived authentication session of the user on that browser, setting a short `Max-Age` or `Expires` parameter on the cookies only results in a degraded user experience.
1111

12-
The only way to ensure that a user has logged out or their session has ended is to get the user's details with `getUser()`.
12+
The only way to ensure that a user has logged out or their session has ended is to get the user's details with `getUser()`. The `getClaims()` method only checks local JWT validation (signature and expiration), but it doesn't verify with the auth server whether the session is still valid or if the user has logged out server-side.

0 commit comments

Comments
 (0)