Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LINE: error state is not specified when attempt to sign in, v5 #9596

Open
Lodimup opened this issue Jan 9, 2024 · 3 comments
Open

LINE: error state is not specified when attempt to sign in, v5 #9596

Lodimup opened this issue Jan 9, 2024 · 3 comments
Labels
bug Something isn't working providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@Lodimup
Copy link
Contributor

Lodimup commented Jan 9, 2024

Provider type

Line

Environment

System:
OS: Linux 6.4 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
CPU: (10) arm64 unknown
Memory: 3.48 GB / 7.66 GB
Container: Yes
Shell: 5.1.4 - /bin/bash
Binaries:
Node: 20.9.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 9.8.1 - /usr/local/bin/npm
pnpm: 8.10.2 - /usr/local/share/npm-global/bin/pnpm
npmPackages:
next: ^14.0.4 => 14.0.4
next-auth: ^5.0.0-beta.4 => 5.0.0-beta.4
react: ^18.2.0 => 18.2.0

Reproduction URL

https://github.com/Lodimup/next-auth-example/tree/main

Describe the issue

cannot sign in using Line provider line returns

http://localhost:3000/api/auth/callback/line?error=INVALID_REQUEST&error_description=%27state%27+is+not+specified.

How to reproduce

ENVs

AUTH_LINE_ID=xxx
AUTH_LINE_SECRET=xxx
This in V5 does not work

import NextAuth from "next-auth";
import Google from "@auth/core/providers/google";
import LINE from "@auth/core/providers/line";

export const {
handlers: { GET, POST },
auth,
} = NextAuth({
providers: [Google, LINE]
})
While the same ID and Secret work fine in V4.
Feeding ID and secret directly also does not work

export const {
handlers: { GET, POST },
auth,
} = NextAuth({
providers: [LINE({ clientId: LINE_CLIENT_ID, clientSecret: LINE_CLIENT_SECRET })
...

Expected behavior

can sign in using line provider

@Lodimup Lodimup added bug Something isn't working providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Jan 9, 2024
@dmacdermott
Copy link

@Lodimup

I had a look at this and to get it working you need to add checks: ["state"] when adding the LINE provider.

   Line({
     clientId: process.env.LINE_CLIENT_ID,
     clientSecret: process.env.LINE_CLIENT_SECRET,
     checks: ["state"],
   })

@Lodimup
Copy link
Contributor Author

Lodimup commented Mar 14, 2024

@Lodimup

I had a look at this and to get it working you need to add checks: ["state"] when adding the LINE provider.


   Line({

     clientId: process.env.LINE_CLIENT_ID,

     clientSecret: process.env.LINE_CLIENT_SECRET,

     checks: ["state"],

   })

Confirmed working solution

@undesicimo
Copy link

Can confirm this fixes the Line provider login, Still curious what is the cause

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working providers triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.
Projects
None yet
Development

No branches or pull requests

3 participants