n4bb12 / verdaccio-github-oauth-ui

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

Generate an error for missing credentials #15

Closed egetin closed 5 years ago

egetin commented 5 years ago

Bug Report

Versions

Version
verdaccio v3.11.6
verdaccio-github-oauth-ui 1.6.1

Expected behavior

If client-id and client-secret are missing, the plugin should throw a descriptive error and stop Verdaccio from starting up.

Observed behaviour

If client-id and client-secret are missing, no errors are brought up on the Verdaccio log and the login button in UI will just open the default login modal.

Steps to reproduce

  1. Leave out the middlewares block from Verdaccio's config.yaml
  2. Start Verdaccio
  3. Click the Login-button on the UI

Additional context

I had written incorrectly middleware: instead of middlewares: in the config.yaml and was wondering for a long time why the plugin wouldn't work (login button opened the default login modal). Some sort of error from missing required configuration would make debugging a lot easier.

n4bb12 commented 5 years ago

Hi @egetin,

sorry for the trouble you've had debugging your configuration.

I've added validation for all required configuration props. You'll now get a message like this:

- [github-oauth-ui] ERR: missing configuration "auth.github-oauth-ui.org", 
- please check your verdaccio config

This is implemented in 1.7.0 https://www.npmjs.com/package/verdaccio-github-oauth-ui

Thanks for reporting!