Skip to content

Commit

Permalink
fix: add auth.jwt() function (supabase#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
kangmingtay authored May 31, 2022
1 parent 3f0b8a2 commit 3259621
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions migrations/20220531120530_add_auth_jwt_function.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- add auth.jwt function

comment on function auth.uid() is 'Deprecated. Use auth.jwt() -> ''sub'' instead.';
comment on function auth.role() is 'Deprecated. Use auth.jwt() -> ''role'' instead.';
comment on function auth.email() is 'Deprecated. Use auth.jwt() -> ''email'' instead.';

create or replace function auth.jwt()
returns jsonb
language sql stable
as $$
select nullif(current_setting('request.jwt.claims', true), '')::jsonb
$$;

0 comments on commit 3259621

Please sign in to comment.