From 7fbc6a958f22748ee1e39782172f19e52a527e90 Mon Sep 17 00:00:00 2001 From: Ollie Halliday <22655069+Hallidayo@users.noreply.github.com> Date: Tue, 16 Aug 2022 21:12:57 +0100 Subject: [PATCH 1/4] getUser documention updated --- apps/reference/_supabase_js/generated/auth-getuser.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/reference/_supabase_js/generated/auth-getuser.mdx b/apps/reference/_supabase_js/generated/auth-getuser.mdx index eecf7850f6f..ff0cae221b9 100644 --- a/apps/reference/_supabase_js/generated/auth-getuser.mdx +++ b/apps/reference/_supabase_js/generated/auth-getuser.mdx @@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem' Gets the current user details if there is an existing session. ```js -const user = supabase.auth.getUser() +const { data, error } = await supabase.auth.getUser(); ``` ## Parameters @@ -50,11 +50,11 @@ Takes in an optional access token jwt. If no jwt is provided, getUser() will att ### Get the logged in user with the current existing session ```js -const user = supabase.auth.getUser() +const { data: { user } } = await supabase.auth.getUser(); ``` ### Get the logged in user with a custom access token jwt. ```js -const user = supabase.auth.getUser(jwt) +const { data: { user } } = await supabase.auth.getUser(jwt); ``` From ad5629cda72666ad2d0456ddceb7331396c7a45b Mon Sep 17 00:00:00 2001 From: Ollie Halliday <22655069+Hallidayo@users.noreply.github.com> Date: Tue, 16 Aug 2022 21:14:29 +0100 Subject: [PATCH 2/4] ran prettier --- apps/reference/_supabase_js/generated/auth-getuser.mdx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/apps/reference/_supabase_js/generated/auth-getuser.mdx b/apps/reference/_supabase_js/generated/auth-getuser.mdx index ff0cae221b9..2dcad472172 100644 --- a/apps/reference/_supabase_js/generated/auth-getuser.mdx +++ b/apps/reference/_supabase_js/generated/auth-getuser.mdx @@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem' Gets the current user details if there is an existing session. ```js -const { data, error } = await supabase.auth.getUser(); +const { data, error } = await supabase.auth.getUser() ``` ## Parameters @@ -50,11 +50,15 @@ Takes in an optional access token jwt. If no jwt is provided, getUser() will att ### Get the logged in user with the current existing session ```js -const { data: { user } } = await supabase.auth.getUser(); +const { + data: { user }, +} = await supabase.auth.getUser() ``` ### Get the logged in user with a custom access token jwt. ```js -const { data: { user } } = await supabase.auth.getUser(jwt); +const { + data: { user }, +} = await supabase.auth.getUser(jwt) ``` From 974dcea811984723ff849e7dacd7da355f7f8a98 Mon Sep 17 00:00:00 2001 From: Ollie Halliday <22655069+Hallidayo@users.noreply.github.com> Date: Thu, 18 Aug 2022 10:08:55 +0100 Subject: [PATCH 3/4] revert changes --- apps/reference/_supabase_js/generated/auth-getuser.mdx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/apps/reference/_supabase_js/generated/auth-getuser.mdx b/apps/reference/_supabase_js/generated/auth-getuser.mdx index 2dcad472172..eecf7850f6f 100644 --- a/apps/reference/_supabase_js/generated/auth-getuser.mdx +++ b/apps/reference/_supabase_js/generated/auth-getuser.mdx @@ -11,7 +11,7 @@ import TabItem from '@theme/TabItem' Gets the current user details if there is an existing session. ```js -const { data, error } = await supabase.auth.getUser() +const user = supabase.auth.getUser() ``` ## Parameters @@ -50,15 +50,11 @@ Takes in an optional access token jwt. If no jwt is provided, getUser() will att ### Get the logged in user with the current existing session ```js -const { - data: { user }, -} = await supabase.auth.getUser() +const user = supabase.auth.getUser() ``` ### Get the logged in user with a custom access token jwt. ```js -const { - data: { user }, -} = await supabase.auth.getUser(jwt) +const user = supabase.auth.getUser(jwt) ``` From 168206aef21f1ec18d3be463738bb3070119b450 Mon Sep 17 00:00:00 2001 From: Ollie Halliday <22655069+Hallidayo@users.noreply.github.com> Date: Thu, 18 Aug 2022 10:13:46 +0100 Subject: [PATCH 4/4] getUser examples changed --- spec/supabase_js_v2_legacy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/supabase_js_v2_legacy.yml b/spec/supabase_js_v2_legacy.yml index e6208bcb81a..5ba0c18210a 100644 --- a/spec/supabase_js_v2_legacy.yml +++ b/spec/supabase_js_v2_legacy.yml @@ -188,13 +188,13 @@ pages: isSpotlight: true js: | ```js - const user = supabase.auth.getUser() + const { data: { user } } = await supabase.auth.getUser() ``` - name: Get the logged in user with a custom access token jwt. isSpotlight: true js: | ```js - const user = supabase.auth.getUser(jwt) + const { data: { user } } = await supabase.auth.getUser(jwt) ``` auth.updateUser(): title: 'updateUser()'