bytespider / jsOAuth

JavaScript implimentation of the OAuth protocol. Currently supports version 1.0 (RFC5849) of the specification. Node.js & CommonJS compatible.
http://bytespider.github.com/jsOAuth/
MIT License
557 stars 109 forks source link

Proxy function instead of fixed url #46

Closed coolhandmook closed 10 years ago

coolhandmook commented 11 years ago

Hi.

I found the proxy more useful as a function. Pretty simple change.

Cheers, Dave.

bytespider commented 11 years ago

I think it would be better if this was a backwards compatible change. proxyUrl should remain intact in its current form

coolhandmook commented 11 years ago

So something like this? Or should I avoid using "callback" because of the callbackUrl? proxyHandler perhaps. Let me know what you prefer and I'll sort it out.

proxyUrl: options.proxyUrl,
proxyCallback: options.proxyCallback,
lukaszkorecki commented 11 years ago

Why not do something like this:


if (oauth.proxy && typeof oauth.proxy == 'function') {
  url = URI(oauth.proxy(url.path, url.query));
} else if(oauth.proxy) {
// .....
}

:question:

bytespider commented 11 years ago

Agree with @lukaszkorecki, this would be a prefect solution. However, don't remove proxyUrl as this functionality is already used by a few people.

coolhandmook commented 11 years ago

Not so simple any more though. :)