From 27c4f9cf3b21900a3c77aad8ab03f12e441e4434 Mon Sep 17 00:00:00 2001 From: Aerilym Date: Sat, 22 Oct 2022 13:52:33 +1100 Subject: [PATCH] Update supabase-js setSession() example --- spec/supabase_js_v2.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/supabase_js_v2.yml b/spec/supabase_js_v2.yml index a1a15b7c1b9..3c58b591862 100644 --- a/spec/supabase_js_v2.yml +++ b/spec/supabase_js_v2.yml @@ -333,17 +333,17 @@ pages: title: 'setSession()' $ref: '@supabase/gotrue-js.GoTrueClient.setSession' notes: | - - `setSession()` takes in a refresh token and uses it to get a new session. + - `setSession()` takes in a refresh token and access token and uses it to get a new session. - The refresh token can only be used once to obtain a new session. - Refresh token rotation (see [`REFRESH_TOKEN_ROTATION_ENABLED`](https://supabase.com/docs/reference/auth/config#refresh_token_rotation_enabled)) is enabled by default on all projects to guard against replay attacks. - You can configure the [`REFRESH_TOKEN_REUSE_INTERVAL`](https://supabase.com/docs/reference/auth/config#refresh_token_reuse_interval) which provides a short window in which the same refresh token can be used multiple times in the event of concurrency or offline issues. examples: - name: Refresh the session - description: Sets the session data from refresh_token and returns current session or an error if the refresh_token is invalid. + description: Sets the session data from a refresh_token and access_token and returns current session or an error if the tokens are invalid. isSpotlight: true js: | ```js - const { data, error } = supabase.auth.setSession(refresh_token) + const { data, error } = supabase.auth.setSession({refresh_token, access_token}) ``` auth.onAuthStateChange(): title: 'onAuthStateChange()'