n4bb12 / verdaccio-github-oauth-ui

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

Cannot GET / in the UI #57

Closed ganapativs closed 4 years ago

ganapativs commented 4 years ago

Bug Report

Plugin breaks with Cannot GET / in the UI when running with npx verdaccio-github-oauth-ui@2.3.1 --registry https://registry.website.com/. This started happening from 2.3.1. The plugin works fine till 2.3.0.

Screenshot 2020-08-12 at 9 49 53 AM

Tested on Mac and Ubuntu, facing the same issue.

Versions

Version
verdaccio 4.7.1
verdaccio-github-oauth-ui 2.3.1

Expected behavior

Should successfully authenticate and update the .npmrc file.

Observed behaviour

Plugin breaks with Cannot GET / in the UI

Steps to reproduce

  1. Run npx verdaccio-github-oauth-ui@2.3.1 --registry https://registry.website.com/
  2. Plugin breaks with Cannot GET / in the UI
n4bb12 commented 4 years ago

Do you have the same problem with 2.3.2?

ganapativs commented 4 years ago

Yes. Both 2.3.1 and 2.3.2 has the same issue. For now, I'm sticking with 2.3.0.

ganapativs commented 4 years ago

Also, the command is still waiting even after the error occurs.

Screenshot 2020-08-12 at 4 39 42 PM
n4bb12 commented 4 years ago

Found the issue. It took me a while to reproduce because it requires a different server and CLI version.

In 2.3.0 the CLI callback path is /. In 2.3.1 the CLI callback path changed to /success, /denied and /error in order to provide better error feedback.

But while the CLI handles redirection and writing the token to .npmrc, the corresponding callback request handler is registered by the server-side Verdaccio plugin. This unclean mix of concerns is now causing your issue.

ganapativs commented 4 years ago

Yes, there is a version mismatch. on the client-side, I was trying with 2.3.1, while, the server has 2.2.4.

On a side note: should we ask for both client and server versions in issue template?

n4bb12 commented 4 years ago

good idea, we could add the node version, too

n4bb12 commented 4 years ago

CLI 2.3.3 works with server versions <=2.3.0 and >=2.3.3.

Thanks you for reporting it! 🍻