mirror of
https://github.com/Since-3/since3-portal.git
synced 2026-10-12 21:41:16 +00:00
see comments
This commit is contained in:
parent
478adcabca
commit
bc71928e1c
5 changed files with 19 additions and 12 deletions
|
|
@ -28,10 +28,10 @@ export const getProfile = cache(async () => {
|
|||
|
||||
export const verifySession = cache(async () => {
|
||||
const user = await getSession()
|
||||
if (!user) redirect("/login")
|
||||
if (!user) redirect("/")
|
||||
|
||||
const profile = await getProfile();
|
||||
if(!profile) redirect("/login")
|
||||
if(!profile) redirect("/")
|
||||
|
||||
return {
|
||||
userId: user.id,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ begin
|
|||
new.id,
|
||||
new.email,
|
||||
coalesce(new.raw_user_meta_data->>'name', ''),
|
||||
coalesce((new.raw_user_meta_data->>'role')::public.user_role, 'client')
|
||||
'client'
|
||||
);
|
||||
return new;
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue