supabase-community/supabase-custom-claims

RPC functions get_my_claims, get_my_claim return null

reaganmac opened this issue · 1 comments

Hi, I've been toying with the custom claims library in my app but found that no matter what I did, get_my_claims and get_my_claim({claim: 'claim_here'}) were not working.

I cloned the included demo application and wired it up, and I am getting the same results. The functions that pull directly from the session (session, session_claims) are returning all of the claims that I have set in the Supabase SQL Query Editor. Also, when logged in with my admin account, the bit at the bottom returns you are a CLAIMS_ADMIN (of course, using the session).

I reran the included install.sql just in case I did a typo initially, but still no joy. The server functions run as expected in the Query Editor.

Any idea on what I might be doing wrong?


Edit: Hmm, I just spun up a fresh Supabase app and everything works like a charm. It must be something I have done along the way though I know not what.

Seems to be an issue with a newer version of PostgREST that came out after my project was started, and how the request.jwt.claims are set.