ghoshnirmalya / nextjs-strapi-boilerplate

:art: Boilerplate for building applications using Strapi and Next.js
https://nextjs-strapi-boilerplate.vercel.app
MIT License
308 stars 82 forks source link

Update starter to Strapi V4 #515

Open rubenbase opened 2 years ago

rubenbase commented 2 years ago

As this starter is being featured in the new v4 examples from Strapi’s blog I think it would make sense to update it as it currently uses Strapi v3.

byoungd commented 2 years ago

Any plan for this?

Cally99 commented 1 year ago

@rubenbase did you ever update this repo to v4?

Leopold-V commented 1 year ago

A bit late here but for those having troubles using this starter with strapi v4 for me it simply has been about reinstalling the strapi part with latest version and then changing the url in nextjs-strapi-boilerplate/frontend/pages/api/auth/[...nextauth].ts

Change this

        const response = await fetch(
          `${process.env.NEXT_PUBLIC_API_URL}/auth/${account.provider}/callback?access_token=${account?.access_token}`
        );

to this:

        const response = await fetch(
          `${process.env.NEXT_PUBLIC_API_URL}/api/auth/${account.provider}/callback?access_token=${account?.access_token}`
        );