koishijs / koishi-plugin-github

GitHub Toolkit for Koishi
https://github.koishi.chat
MIT License
9 stars 3 forks source link

Bug: Github oauth未正常工作 #1

Open vlssu opened 2 years ago

vlssu commented 2 years ago

Describe the bug

Github oauth未正常工作,无法正确的绑定到用户

Steps to reproduce

如下面的截图所配置,然后按照正常的流程走即可出现

Expected behavior

成功绑定用户

Screenshots

image image image

Versions

Additional context

https://user-images.githubusercontent.com/43847794/165428566-1a26a4ce-e09f-436c-8cea-0778d58d21ae.mp4

shigma commented 2 years ago

@MaikoTan 这个 issue 大概是怎么回事?

MaikoTan commented 2 years ago

@MaikoTan 这个 issue 大概是怎么回事?

Idk, with the latest version now (5.0.2) I can only reproduce the error codes 422 and 408 in authorizing phase. (But I still am not able to make it work either, maybe not the same issue) I would read some GitHub documents and investigate this issue later.

MaikoTan commented 1 year ago

https://github.com/koishijs/koishi-plugin-github/blob/44b5845c7db9a5cd0e06d6e9bc0337cfb4830102/src/server.ts#L120-L130

Looks like the code here requests the URL with query parameter instead of HTTP body, is it expected?

shigma commented 1 year ago

Looks like the code here requests the URL with query parameter instead of HTTP body, is it expected?

I think I'm doing what the documentation says.

https://docs.github.com/en/developers/apps/building-oauth-apps/authorizing-oauth-apps#2-users-are-redirected-back-to-your-site-by-github

std-microblock commented 1 year ago

As for my experience, if config.redirect is misconfigured, the api would be likely to return a 4xx error. Also, there seems not to be any configuration check here.

colour93 commented 1 year ago

我也遇到了,无论是配置了 config.redirect 还是使用默认,都会出现如上问题,且最终绑定不成功

postyizhan commented 4 months ago

遇到同样问题

SeeleVolleri commented 3 months ago

koishi 4.17.7 koishi-plugin-github 5.5.1 2024-07-21 01:32:59 [W] github Error: Unprocessable Entity at [cordis.invoke] (/koishi/node_modules/@cordisjs/plugin-http/lib/index.cjs:335:23) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async Proxy.request (/koishi/node_modules/koishi-plugin-github/lib/index.js:77:20) at async Command. (/koishi/node_modules/koishi-plugin-github/lib/command.js:68:28) at async Array. (/koishi/node_modules/@koishijs/core/lib/index.cjs:1121:14) at async Command.execute (/koishi/node_modules/@koishijs/core/lib/index.cjs:1135:22) at async /koishi/node_modules/@koishijs/core/lib/index.cjs:2154:22 at async Proxy.withScope (/koishi/node_modules/@koishijs/core/lib/index.cjs:2057:22) at async next (/koishi/node_modules/@koishijs/core/lib/index.cjs:860:16) at async next (/koishi/node_modules/@koishijs/core/lib/index.cjs:860:16)