trypear / pear-landing-page

Landing page for PearAI, the Open Source AI-Powered Code Editor
https://trypear.ai
23 stars 32 forks source link

Supabase Auth #12 #20

Closed Ellahinator closed 3 weeks ago

Ellahinator commented 3 weeks ago

Addresses the following issue:

This PR introduces authentication actions and middleware for Supabase, including Google OAuth and basic email/password authentication.

Setup Instructions:

Must Do:

  1. Copy .env.local.example into .env.local and set up the following environment variables:
NEXT_PUBLIC_SUPABASE_URL=<your_supabase_project_url>
NEXT_PUBLIC_SUPABASE_ANON_KEY=<your_supabase_anon_key>
NEXT_PUBLIC_REDIRECT_URL=http://localhost:3000 # or the production URL
  1. To get Google OAuth working, please follow this guide: Supabase Google Signup

TODO:

vercel[bot] commented 3 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
pear-landing-page ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 9, 2024 5:34pm
Ellahinator commented 3 weeks ago

need to fix redirectTo not working with Google signing. fixed: https://github.com/trypear/pear-landing-page/pull/20/commits/ac58ced0ec2660cd018efd3496a16d69417f4b56

shrix1 commented 3 weeks ago

Hey, @Fryingpannn @nang-dev ,Supabase email SMTP is super bad (PRO plan also 10-20 email only). So, we can use Resend SMTP for auth OTP verification and Welcome email and other stuffs.

check the Pricing below :

Screenshot 2024-06-07 at 10 38 26 AM
shrix1 commented 3 weeks ago

Hey, Nice work @Ellahinator Im working on adding Custom SMTP Issue : https://github.com/trypear/pear-landing-page/issues/21

Ellahinator commented 3 weeks ago

We can merge this by having 2 extra things Logout button working Feature flag checking to only show the buttons if on local (we don't want this in prod yet as not fully complete, but can merge current pr first)

These two have been implemented.

Whats left that should be prioritized is

Fryingpannn commented 3 weeks ago

FYI

https://discord.com/channels/1237009981803462729/1247633935748435990/1249112511882465382

Confirmed with @ItWasEnder regarding user data flow, who is working on creating the db schema for a custom user table.

When users sign up, their info is stored in the default auth schema's users table (the one automatically linked with the supabase auth). We have a database trigger which will then automatically also insert these new users in our custom user table.

This custom user table is where we will perform reads from. I think this is also what you're referring to in the Managing User Data link you mentioned.

Fryingpannn commented 3 weeks ago

Solve merge conflict and we can merge! Good shiet 👏

Ellahinator commented 3 weeks ago

Should be good to merge @Fryingpannn