Next.js Discord

Discord Forum

I get code from Notion but have no idea what to do with it

Unanswered
Rhinelander posted this in #help-forum
Open in Discord
RhinelanderOP
I use Auth.js v5 I did everything guide says

import NextAuth from 'next-auth';
import Notion from 'next-auth/providers/notion';

export const { handlers, signIn, signOut, auth } = NextAuth({
  providers: [
    Notion({
      clientId: process.env.AUTH_NOTION_ID,
      clientSecret: process.env.AUTH_NOTION_SECRET,
      redirectUri: process.env.AUTH_NOTION_REDIRECT_URI!,
    }),
  ],
});

It works great it redirect me to Notion screen to select some stuff and redirect me after but when it redirects me i get URL params that i don't know what do do with.
I get state that is empty and code that is not empty. I am not even logged in. Google, GitHub etc... all of them are straight forward easy to implement but i have no idea what to do here. How do I authenticate? How do I access notion pages that user selected etc... Image bellow shows how i check if it is logged in but it always returns signin button

1 Reply

RhinelanderOP
Oh and I just got this in the console