Removed opinionated protocol setting#1563
Removed opinionated protocol setting#1563troykelly wants to merge 1 commit intofeathersjs:masterfeathersjs/feathers:masterfrom
Conversation
|
This part of the code was just refined 2 weeks ago - #1543 and we were pretty happy with the result. Could you describe what you're trying to do that's not working as expected (e.g. give example URLs)? You can configure the port/protocol business for each environment in your configuration files if the defaults don't work: Defaults are designed to fit typical use cases:
|
|
I'm trying to not have http:// appended to the URI. The change in #1543 is quite opinionated when it comes to the non-production environment, forcing the protocol to I'm not sure how I could configure https and no port in the config file - it appears to be set here and doesn't reference any config? |
|
OK. I see your issue, but I think this is all configurable. In your config file (I'm using yml, but it's the same in json), there are 2 significant parts of config for your use case: # this is how the app is running locally
# this is also used to generate defaults for oauth
host: localhost
port: 3030
# but you can override oauth defaults to whatever you need
authentication:
oauth:
defaults:
host: custom-host-with-or-without-port.com
protocol: custom-protocol-irrespective-of-environmentIf you don't put anything in Since you want to use no port in development, you can just override that directly with: authentication:
oauth:
defaults:
host: myapp.ngrok.io
protocol: httpsLet me know if that worked or if I'm still missing something. The relevant part of the code btw is this bit where feathers deeply merges the generated defaults with your own defaults (and the rest of oauth configuration): https://github.com/compwright/feathers/blob/master/packages/authentication-oauth/src/index.ts#L28-L35 |
|
Thank you for the pull request! As per the discussion, I think we should leave it the way it is for now since it is always possible to customize those settings. |
Problem
OAuth requests do not possess the ability to set the protocol and port from the configuration.
In addition, when in a development environment, the opinionated nature of the protocol setting forced a
redirect_urlwith only ahttp://protocol.