timtbdev / Next.js-Blog-App

✨ Multi-User, Full-stack blogging application built with Next.js and Supabase.
https://ink.mn
323 stars 57 forks source link

can't login nor see posts #9

Open PrestigeDevop opened 8 months ago

PrestigeDevop commented 8 months ago

hello , thanks for sharing this project , I've encounter some problems linking the project to supabase .. I'm new to next and suabase ,

I've setup the env variables details and enable Supabase's authorizations settings ( Google and Github Client ID and Secret api),

but I couldn't login into the editor/postsroute .

is there something I need to edit in Vercel or supabase ? also idk how to fetch the articles from the db ,, should I upload it into supabase and if so how ?

raphaelandrews commented 8 months ago

Are you unable to login only on the editor/posts route or on all protected routes? Which errors are you receiving? Are users being created?

PrestigeDevop commented 8 months ago

Are you unable to login only on the editor/posts route or on all protected routes? Which errors are you receiving? Are users being created?

I can't authenticate users .I've enabled Github ,Google and Email in Spabase . but the login redirect me into the same page (reloading the website ) // might be wrong way to authenticate , the email option indeed create a user but it's hard coded by me so it's more prone to error -bugs .

is there any additional thing I need to do in the supabase backend i.e how can I upload the articles and sql file ?

I've a Vercel deployment but I need to fix it

raphaelandrews commented 8 months ago

I don't know if it's the same case I have. When I first tried to authenticate with Google, I couldn't authenticate and got redirected to localhost:3000 because I forgot to change the Site URL in Supabase. Authentication -> URL Configuration, and then I changed the site URL from localhost:3000 to my Vercel deployment URL.

If you're referring to the schema and dummy data, you can utilize the SQL Editor to create the tables. Then, navigate to the Table Editor, select the Posts table, and choose Insert -> Import data from CSV. However, if you create a post using the New Post button on the editor/posts route, the new post will be inserted into the Drafts table and won't be displayed on the homepage. You can check https://github.com/timtbdev/Next.js-Blog-App/issues/8 to change this thing.

PrestigeDevop commented 7 months ago

//Google OAuth it reload the page with this error in the console


supabase.co/rest/v1/profiles?select=*&id=eq.undefined
Request Method:
GET
Status Code:
404 Not Found

{
    "code": "42P01",
    "details": null,
    "hint": null,
    "message": "relation \"public.profiles\" does not exist"
}
raphaelandrews commented 7 months ago

Are you using triggers? Check https://github.com/timtbdev/Next.js-Blog-App/issues/5