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

wechat's text/plain response cause oauth4webapi throw error so next-auth wechat login failed #12656

Open
xiangnanscu opened this issue Feb 16, 2025 · 1 comment
Labels
bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

Comments

@xiangnanscu
Copy link

Environment

  System:
    OS: Linux 5.4 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (32) x64 AMD Ryzen 9 5950X 16-Core Processor
    Memory: 42.71 GB / 50.14 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 20.9.0 - /usr/bin/node
    Yarn: 1.22.21 - /usr/bin/yarn
    npm: 10.1.0 - /usr/bin/npm
    pnpm: 8.15.1 - /usr/bin/pnpm
    bun: 1.1.42 - ~/.bun/bin/bun

Reproduction URL

https://github.com/xiangnanscu/wecha-login

Describe the issue

the error lines in oauth4webapi's processGenericAccessTokenResponse function logic. As the author doesn't want to change it, so would you mind solve this?

@KaygNas

#10236

this is related code:
panva/oauth4webapi#155

How to reproduce

the code's like:

import WeChat from '@auth/core/providers/wechat';

import { CommonProviderConfig } from './sso.config';

const provider = {
  id: 'wechat',
  provider: WeChat({
    ...CommonProviderConfig,
    clientId: process.env.AUTH_WECHAT_ID,
    clientSecret: process.env.AUTH_WECHAT_SECRET,
    platformType: 'WebsiteApp',
    profile: (profile) => {
      return {
        email: null,
        id: profile.unionid,
        image: profile.headimgurl,
        name: profile.nickname,
        providerAccountId: profile.unionid,
      };
    },
  }),
};

export default provider;

Then the end user scan qrcode, approve, and then error happend.

Expected behavior

no error

@xiangnanscu xiangnanscu added bug Something isn't working triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Feb 16, 2025
@wcu1117
Copy link

wcu1117 commented Feb 17, 2025

it's true,I found the error last week,I kown why,i will pull a request try to fixed it.

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

No branches or pull requests

2 participants