trrd
10/12/2022, 8:16 AMShelby
10/12/2022, 9:00 AMjs
{
data: { user: null },
error: AuthApiError: Internal server error
at C:\Users\Riot\Documents\Project\node_modules\@supabase\gotrue-js\dist\main\lib\fetch.js:41:20
at runMicrotasks (<anonymous>)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
__isAuthError: true,
status: 500
}
}
I get this error when I sign in + No cookies are set in the browserGaryLake
10/12/2022, 9:43 AMin
10/12/2022, 11:05 AMfelixthehat
10/12/2022, 11:09 AMMonk
10/12/2022, 12:28 PMTomCarnay
10/12/2022, 12:33 PMThoth Trismegistus
10/12/2022, 1:35 PMMigu
10/12/2022, 2:05 PMlocalStorage
). I would instead prefer to re-order for everyone at the same time (see screenshot attached)
Maybe through some SQL statements?
Cheers!Martin INDIE MAKERS
10/12/2022, 2:25 PMkarol_123
10/12/2022, 3:06 PMrgfx
10/12/2022, 3:07 PMyml
# Comment out everything below this point if you are using an external Postgres database
db:
container_name: supabase-db
image: supabase/postgres:14.1.0.21
command: postgres -c config_file=/etc/postgresql/postgresql.conf
restart: unless-stopped
ports:
- ${POSTGRES_PORT}:5432
environment:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- ./volumes/db/data:/var/lib/docker/volumes/1c348aa63f846262ae48c2137bb77eb031cda8355ac18454f8b9412254d5d2ae/_data
# - ./volumes/db/init:/docker-entrypoint-initdb.d
I missing something I should change?bobmolgui
10/12/2022, 3:20 PMimport { SessionContextProvider } from '@supabase/auth-helpers-react';
that Property 'initialSession' does not exist on type '{}'. Can somebody help me with solving this? Thanks
<SessionContextProvider
supabaseClient={supabaseClient}
initialSession={pageProps.initialSession}
>
cbunge3
10/12/2022, 3:30 PMJason Creviston
10/12/2022, 4:33 PMsetSession()
will only refresh your tokens if the access_token
has expired. Before this merge, setSession()
would give you new tokens even if the access_token was still valid.
Or am I just missing something? (the most likely scenario)
https://github.com/supabase/gotrue-js/pull/467πβ ΡΓβο½ε π²π₯
10/12/2022, 4:57 PMdocker compose up
https://pastebin.com/LvP7qyqnThoth Trismegistus
10/12/2022, 5:16 PMRubensNobre
10/12/2022, 5:51 PMNick
10/12/2022, 6:07 PMbash
error - Error: {"code":"42501","details":null,"hint":null,"message":"new row violates row-level security policy for table \"users\""}
at Object.getProperError (D:\development\coding\typescript\blog\node_modules\next\dist\lib\is-error.js:25:12)
at DevServer.run (D:\development\coding\typescript\blog\node_modules\next\dist\server\dev\next-dev-server.js:712:39)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async DevServer.handleRequest (D:\development\coding\typescript\blog\node_modules\next\dist\server\base-server.js:285:20)
The RLS expression on the user
table is (user_id() = (user_id)::text)
which before was auth.user_id()=user_id
but the dashboard seems to automatically change it.
The problem I think is, on the docs it says:
The payload in the JWT will have the following structure
{
userId,
exp
}
When in reality when I decode the JWT token myself I get
{"alg":"HS256","typ":"JWT"}{"userId":"f2a17d0b-a783-46ca-bb5c-cef944a9d4c7","exp":1665597882,"iat":1665594282}
the thing is I had to create a SQL function for auth.user_id()
postgres
create or replace function auth.user_id() returns text as $$
select nullif(current_setting('request.jwt.claims', true)::json->>'userId', '')::text;
$$ language sql stable;
I think this function does not work because the structure of the JWT token doesn`t work with the one I am having... and I am not that expirienced with postgres to fix it myself, is anyone here able to help me out here?
Thanks!AllYourSupabase
10/12/2022, 6:24 PMsosapps
10/12/2022, 6:34 PMaquila
10/12/2022, 7:02 PMncbphi001
10/12/2022, 7:06 PMMC
10/12/2022, 8:17 PMlewisd
10/12/2022, 9:10 PMconst notificationSubscribe = supabase .channel(public:notifications:receiverId=eq.${currentUser?.id}AND????)
Can I chain an AND filter here?lifelesspizza
10/12/2022, 9:34 PMgustavoeliasexe
10/12/2022, 9:57 PMIllia
10/12/2022, 10:12 PMid
Julien
10/12/2022, 10:16 PMVWL Tobias Hassebrock
10/12/2022, 10:19 PM-- how can I access if a user is loggedIn?
CREATE POLICY "LoggedIn users can view posts."
ON posts
FOR SELECT
USING (if(userLoggedInWithPasswordAndEmail));
-- is true correct here?
CREATE POLICY "Everyone can view profiles - even if not logged in"
ON profiles
FOR SELECT
USING (true);