n4bb12 / verdaccio-github-oauth-ui

📦🔐 GitHub OAuth plugin for Verdaccio
https://verdaccio.org
MIT License
73 stars 45 forks source link

Error: Failed requesting GitHub user\teams\orgs info: Not Found #138

Closed vailshnast closed 2 years ago

vailshnast commented 2 years ago

So i basically trying to make a unity npm registry by following this guide. https://medium.com/@markushofer/run-your-own-unity-package-server-b4fe9995704e

Seems like this is the only working solution for auth with github. Also correct me if im wrong, would im be able to push packages from github using this auth?

Bug Report

Error: Failed requesting GitHub user info: Not Found at GitHubClient. (/usr/lib/node_modules/verdaccio-github-oauth-ui/dist/server.js:1102:21) at step (/usr/lib/node_modules/verdaccio-github-oauth-ui/dist/server.js:997:17) at Object.throw (/usr/lib/node_modules/verdaccio-github-oauth-ui/dist/server.js:928:14) at rejected (/usr/lib/node_modules/verdaccio-github-oauth-ui/dist/server.js:890:32)

Error: Failed requesting GitHub user teams: Not Found at GitHubClient. (/usr/lib/node_modules/verdaccio-github-oauth-ui/dist/server.js:1178:21) at step (/usr/lib/node_modules/verdaccio-github-oauth-ui/dist/server.js:997:17) at Object.throw (/usr/lib/node_modules/verdaccio-github-oauth-ui/dist/server.js:928:14) at rejected (/usr/lib/node_modules/verdaccio-github-oauth-ui/dist/server.js:890:32)

Versions

Version
node.js v16.13.0
verdaccio v5.2.2
verdaccio-github-oauth-ui (Plugin) 3.1.0

Expected behavior

Verdaccio successfully auths with github.

Observed behaviour

Getting a Error: Failed requesting GitHub user info: Not Found error.

Steps to reproduce

1.Follow this tutorial https://medium.com/@markushofer/run-your-own-unity-package-server-b4fe9995704e 2.Install verdaccio-github-oauth-ui 3.Use this config https://prnt.sc/20ag2ca 4.Run verdaccio 5.Login

Additional context

https://prnt.sc/20aez8h https://prnt.sc/20am5tc

n4bb12 commented 2 years ago

Thanks for reporting. I'll look into it.

n4bb12 commented 2 years ago

The https://prnt.sc links seem to be dead. Could you share your config as a code snippet here on the issue?

vailshnast commented 2 years ago

@n4bb12 Sorry i have deleted when reseted vm instance, but i can still share with Screenshot_2 image.

n4bb12 commented 2 years ago

I think the enterprise-origin config is causing the issue.

This option is only intended for enterprise deployments of GitHub (as the name says), not the public github.com. GitHub enterprise APIs run on a sub-path while public GitHub APIs are hosted on a subdomain. So setting this option to the public GitHub will result in invalid URLs and the 404 status codes you're getting.

I can also see that your org is set to a URL. This should only be the org name.