perfood / couch-auth

Powerful authentication for APIs and apps using CouchDB (or Cloudant) with Node >= 14
MIT License
68 stars 19 forks source link

[Question] is there an option guard register route? #32

Closed arnoldtkl closed 2 years ago

arnoldtkl commented 2 years ago

Hi, thanks for maintaining this library! I appreciate the effort to keep this library updated constantly.

I was just wondering if there is an option to guard the register route with logged in users? Because I have a private system which does not allow public users to register or login.

fynnlyte commented 2 years ago

Have a look at requireAuth. It should be possible to intercept requests to /register with an auth check before passing them on.

arnoldtkl commented 2 years ago

Ok, thanks for the guidance!