question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Line Provider Callback got: undefined

See original GitHub issue

Question 💬

When I login from line provider. callback got code and state from line but nextauth error got undefinded image

image ps. I test in local but I config windows host to virtual domain.

#environment

{
  "name": "login",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev -p 6100",
    "build": "next build",
    "start": "next start",
    "lint": "next lint"
  },
  "dependencies": {
    "next": "11.1.2",
    "next-auth": "4.0.0-beta.4",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  },
  "devDependencies": {
    "@types/react": "17.0.27",
    "eslint": "8.0.0",
    "eslint-config-next": "11.1.2",
    "typescript": "4.4.3"
  }
}

How to reproduce ☕️

export default NextAuth({
    providers: [
        Google({
            clientId: process.env.GOOGLE_ID,
            clientSecret: process.env.GOOGLE_SECRET,
        }),
        LineProvider({
            clientId: process.env.LINE_CLIENT_ID,
            clientSecret: process.env.LINE_CLIENT_SECRET
        }),
        FacebookProvider({
            clientId: process.env.FACEBOOK_CLIENT_ID,
            clientSecret: process.env.FACEBOOK_CLIENT_SECRET
        })
    ],
    // session: {
    //     jwt: true
    // }
    jwt: {
        secret: "1234"
    },
    pages: {
        signIn: "/signin"
    },
})

Contributing 🙌🏽

No, I am afraid I cannot help regarding this

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
balazsorban44commented, Oct 28, 2021

@ThangHuuVu if that is a setting general for the LineProvider, we could add it to the default config instead?

1reaction
ThangHuuVucommented, Oct 28, 2021

Upgrading to v4.0.0-beta5 solves this. Note that you need to add the following option to the provider:

LineProvider({
      clientId: process.env.LINE_CHANNEL_ID,
      clientSecret: process.env.LINE_CHANNEL_SECRET,
      client: {
        id_token_signed_response_alg: "HS256", // --> add this
      },
    }),
Read more comments on GitHub >

github_iconTop Results From Across the Web

Route.get() requires callback functions but got a "object ...
Error: Route.get() requires callback functions but got a [object Undefined] This exception is thrown when route.get does not get a callback function.
Read more >
Asynchronous context tracking | Node.js v19.3.0 Documentation
Any getStore() call done within the callback function will always return undefined . The optional args are passed to the callback function. If...
Read more >
Resolving the JavaScript Promise Error "TypeError: Cannot ...
TypeError - Cannot read property 'then' of undefined is thrown when the caller is expecting a Promise to be returned and instead receives ......
Read more >
Top 10 Most Common Node.js Developer Mistakes - Toptal
The Top 10 Most Common Mistakes That Node.js Developers Make · Mistake #1: Blocking the event loop · Mistake #2: Invoking a Callback...
Read more >
What to do when “this” loses context - freeCodeCamp
this loses context when the method is used as a callback. Consider the next class: class Service { constructor(){ this.token = "token"; } ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found