Is there any way to create organization after user create hook?
Im getting UNAUTHORIZED error because im trying to create an organization for user with using user : { create : { after { } }} hook.
Is there any way to avoid it?
Solution:Jump to solution
since you have the user id, remove
headers
and pass userId
in the body instead8 Replies
@Ping @bekacru
Solution
since you have the user id, remove
headers
and pass userId
in the body insteadoh okeyy
thanks
hi, I have same question. How can I create an org after new user signs up? In you code snippet how do you get access to auth instance?
you can still use the current auth instance, and use the userId: user.id directly like @bekacru , unnecessary to use headers()
I dont have create organization code but i have set active organization to session for every sign in
Its easy to make
Thanks for the snippet and answer! I made it working now!