forked from supabase/auth
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add auth.jwt() function (supabase#484)
- Loading branch information
1 parent
3f0b8a2
commit 3259621
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
$$; |