From 9ca4fb29d8b55843b93221e702a6c310b820be7c Mon Sep 17 00:00:00 2001 From: PM <65325+j2l@users.noreply.github.com> Date: Sat, 6 Mar 2021 17:10:26 +0100 Subject: [PATCH] To fix error on Firefox 85.0.1 (Ubuntu 20.04) On firefox, I got: ``` Uncaught TypeError: supabase.auth.user().then is not a function fetchUserDetails http://192.168.1.230:8080/index.js:62 EventHandlerNonNull* http://192.168.1.230:8080/index.js:18 EventListener.handleEvent* http://192.168.1.230:8080/index.js:10 index.js:62:6 fetchUserDetails http://192.168.1.230:8080/index.js:62 fetchUserDetails self-hosted:1176 (Async: EventHandlerNonNull) http://192.168.1.230:8080/index.js:18 (Async: EventListener.handleEvent) http://192.168.1.230:8080/index.js:10 ``` My solution might not be the best but it makes it work :) Please continue showing examples about direct access from javascript client (like Firebase do). --- examples/javascript-auth/index.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/examples/javascript-auth/index.js b/examples/javascript-auth/index.js index 67c2089761c..5b16fdf6043 100644 --- a/examples/javascript-auth/index.js +++ b/examples/javascript-auth/index.js @@ -56,16 +56,10 @@ const logInSubmitted = (event) => { } const fetchUserDetails = () => { - supabase.auth - .user() - .then((response) => { - alert(JSON.stringify(response)) - }) - .catch((err) => { - alert(err.response.text) - }) + alert(JSON.stringify(supabase.auth.user())) } + const logoutSubmitted = (event) => { event.preventDefault()