-
-
Notifications
You must be signed in to change notification settings - Fork 422
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: messages when recipient doesn't have auth_id (#4152)
- Loading branch information
1 parent
dcd00f8
commit 25e4848
Showing
2 changed files
with
17 additions
and
3 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
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,10 @@ | ||
CREATE OR REPLACE FUNCTION public.get_user_email_by_username(username text) | ||
RETURNS TABLE(email character varying) | ||
LANGUAGE plpgsql | ||
SECURITY DEFINER | ||
AS $function$ | ||
BEGIN | ||
RETURN QUERY SELECT au.email FROM auth.users au WHERE au.raw_user_meta_data->>'username' = $1; | ||
END; | ||
$function$ | ||
; |