broad-emeraldB
Refine2y ago
17 replies
broad-emerald

Supabase Authentication Trigger & Refine App Integration Question

Hi everyone,

I hope you're all doing well. I am encountering a challenge with Supabase Authentication in my Refine apps and would appreciate your guidance.

Problem:
I have two separate apps, a Merchant app, and a Consumer app, both utilizing Refine. Each app has its own user profile table (merchant_profiles for the Merchant app and consumer_profiles for the Consumer app). However, both apps share the same auth.users table in Supabase. When a user logs into the Merchant app, I need to copy information from auth.users to merchant_profiles, and similarly for the Consumer app.

Question:
How can I create a trigger in Supabase to automatically copy information from auth.users to the respective profile tables upon login? Additionally, how would I handle this in the authentication solution with Refine?

Note: I am using Google Authentication service also.
Was this page helpful?