joschan21 / quill

Quill - A Modern SaaS-Platform Built With Next.js 13
1.91k stars 513 forks source link

Log in Callback Error #17

Open JasonMKY opened 1 year ago

JasonMKY commented 1 year ago

I added all the links to the callback in Kinde, does it take time to update? I added all necessary links and still get this callback error... image

Still get this error when trying to log in: image

anand-mukul commented 1 year ago

@JasonMKY Callback URL : https://pdf2-beta.vercel.app/api/auth/kinde_callback http://localhost:3000/api/auth/kinde_callback Logout URL : https://pdf2-beta.vercel.app http://localhost:3000

JasonMKY commented 1 year ago

@JasonMKY Callback URL : https://pdf2-beta.vercel.app/api/auth/kinde_callback http://localhost:3000/api/auth/kinde_callback Logout URL : https://pdf2-beta.vercel.app http://localhost:3000

Still getting the error

anand-mukul commented 1 year ago

@JasonMKY clear cache and try again

JasonMKY commented 1 year ago

@JasonMKY clear cache and try again

Cleared caches and tried in incognito mode, error still there: image

anand-mukul commented 1 year ago

@JasonMKY There is problem in your env, Recheck that Also, share your ..src\lib\utils.ts

JasonMKY commented 1 year ago

I put everything correctly in environment setup image

Src/lib/utils.ts file:

import { type ClassValue, clsx } from 'clsx'
import { Metadata } from 'next'
import { twMerge } from 'tailwind-merge'

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs))
}

export function absoluteUrl(path: string) {
  if (typeof window !== 'undefined') return path
  if (process.env.VERCEL_URL)
    return `https://${process.env.VERCEL_URL}${path}`
  return `http://localhost:${
    process.env.PORT ?? 3000
  }${path}`
}

export function constructMetadata({
  title = "Quill - the SaaS for students",
  description = "Quill is an open-source software to make chatting to your PDF files easy.",
  image = "/thumbnail.png",
  icons = "/favicon.ico",
  noIndex = false
}: {
  title?: string
  description?: string
  image?: string
  icons?: string
  noIndex?: boolean
} = {}): Metadata {
  return {
    title,
    description,
    openGraph: {
      title,
      description,
      images: [
        {
          url: image
        }
      ]
    },
    twitter: {
      card: "summary_large_image",
      title,
      description,
      images: [image],
      creator: "@joshtriedcoding"
    },
    icons,
    metadataBase: new URL('https://quill-jet.vercel.app'),
    themeColor: '#FFF',
    ...(noIndex && {
      robots: {
        index: false,
        follow: false
      }
    })
  }
anand-mukul commented 1 year ago

image

Go to... Kinde>Application>Quick Start

Existing codebase

https://pdf2-beta.vercel.app Edit the link

You will get environment vars

JasonMKY commented 1 year ago

EDIT: Fixed

When I log in/register this error is showing when going to "/dashboard"

image

Error in Log:

Status Code 200

image image

Code in blue highlight below

PrismaClientKnownRequestError: 
Invalid `prisma.user.findFirst()` invocation:

The table `(not available)` does not exist in the current database.
    at wn.handleRequestError (/var/task/node_modules/.pnpm/@prisma+client@5.3.1_prisma@5.3.1/node_modules/@prisma/client/runtime/library.js:123:6730)
    at wn.handleAndLogRequestError (/var/task/node_modules/.pnpm/@prisma+client@5.3.1_prisma@5.3.1/node_modules/@prisma/client/runtime/library.js:123:6119)
    at wn.request (/var/task/node_modules/.pnpm/@prisma+client@5.3.1_prisma@5.3.1/node_modules/@prisma/client/runtime/library.js:123:5839)
    at async l (/var/task/node_modules/.pnpm/@prisma+client@5.3.1_prisma@5.3.1/node_modules/@prisma/client/runtime/library.js:128:9763)
    at async m (/var/task/.next/server/app/dashboard/page.js:1:8592) {
  code: 'P2021',
  clientVersion: '5.3.1',
  meta: { table: '(not available)' }
}
[Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] {
  digest: '2695897097'
}
PrismaClientKnownRequestError: 
Invalid `prisma.user.findFirst()` invocation:

The table `(not available)` does not exist in the current database.
    at wn.handleRequestError (/var/task/node_modules/.pnpm/@prisma+client@5.3.1_prisma@5.3.1/node_modules/@prisma/client/runtime/library.js:123:6730)
    at wn.handleAndLogRequestError (/var/task/node_modules/.pnpm/@prisma+client@5.3.1_prisma@5.3.1/node_modules/@prisma/client/runtime/library.js:123:6119)
    at wn.request (/var/task/node_modules/.pnpm/@prisma+client@5.3.1_prisma@5.3.1/node_modules/@prisma/client/runtime/library.js:123:5839)
    at async l (/var/task/node_modules/.pnpm/@prisma+client@5.3.1_prisma@5.3.1/node_modules/@prisma/client/runtime/library.js:128:9763)
    at async u (/var/task/.next/server/chunks/753.js:1:732)
    at async z (/var/task/.next/server/chunks/951.js:1:13423) {
  code: 'P2021',
  clientVersion: '5.3.1',
  meta: { table: '(not available)' }
}
[Error: An error occurred in the Server Components render. The specific message is omitted in production builds to avoid leaking sensitive details. A digest property is included on this error instance which may provide additional details about the nature of the error.] {
  digest: '341264739'
}
suzushi-tw commented 1 year ago

anand

HI anand, first of all thanks for all the otherpost as it helped me overcome some issue. I have no idea if my current problem relate to the other post. First I was getting 500internal error while signing in. And after someadjustment I was able to solve it and get to the registerpage. This time able to register and receive the authentication code (I double checked in kinde that I successfully registered). But then instead of getting routed to the dashboard. I just get 404 Page not found. Any idea on how to solve this?

anand-mukul commented 1 year ago

Have you watched @joschan21 Tutorials? You can find it here: https://youtu.be/ucX2zXAZ1I0?si=XN9jWmqWNtRJsPUD

Alternatively, did you set up your own .env credentials? I noticed in your code that you haven't made any changes. I recommend updating it according to your .env credentials. Once you do that, you'll be good to go, @suzushi-tw ! 👍

suzushi-tw commented 1 year ago

Have you watched @joschan21 Tutorials? You can find it here: https://youtu.be/ucX2zXAZ1I0?si=XN9jWmqWNtRJsPUD

Alternatively, did you set up your own .env credentials? I noticed in your code that you haven't made any changes. I recommend updating it according to your .env credentials. Once you do that, you'll be good to go, @suzushi-tw ! 👍

Actually that was just a repo to test eveything out including the domain. I am following the tutorial on local and I have the enviroment variable set up properly as well. An update on what was happening, basically it was telling me images.remotepatterns missing so I setup those in next.config.js. And a bit of trying around, now I can get to the dashboard. I am currently stuck on uploadthing, as it gives me fetch error. Even though I can see the file being uploaded into the server. The error looks like the following pic. Screenshot 2023-10-16 105713

I have rewatched the video about this part a few times and couln't figure it out yet. Any suggestions?

anand-mukul commented 1 year ago

Please give it a star and check out this repository: https://github.com/anand-mukul/PDFNinja. Since I am unable to find your code, I can't identify the exact issue.

Check 2nd line of your picture it's https://https://stellar......

KLGH24 commented 1 year ago

@anand-mukul I checked out PDFNinja and I am unable to interact with the pdf. It's the same error I am getting 404. Is this due to Pinecone changes not allowing name spaces for free anymore?

ck18sss commented 11 months ago

I added all the links to the callback in Kinde, does it take time to update? I added all necessary links and still get this callback error... image

Still get this error when trying to log in: image

I'm still struggling with this issue unfortunately. My auth won't work, keep getting a callback error when everything is correct.

AutomatykaJava commented 10 months ago

You can try alternative way to remove and add callbacks in kinde. Did not tried it yet, but in their documentation there are endpoints to do it. Maybe this is a way.