Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flexible handling of callback for auth methods #175

Closed
mattheworiordan opened this issue Dec 9, 2015 · 0 comments
Closed

Flexible handling of callback for auth methods #175

mattheworiordan opened this issue Dec 9, 2015 · 0 comments
Assignees
Labels
enhancement New feature or improved functionality.

Comments

@mattheworiordan
Copy link
Member

See https://jsbin.ably.io/ukinas/2/edit. It fails because the callback provided is the second argument instead of the third, however for other methods like requestToken it is allowed as the second argument, see

/* shuffle and normalise arguments as necessary */
if(typeof(tokenParams) == 'function' && !callback) {
callback = tokenParams;
authOptions = tokenParams = null;
}
else if(typeof(authOptions) == 'function' && !callback) {
callback = authOptions;
authOptions = null;
}
.

I propose for all Auth methods createTokenRequest and authorise, we provide the same consistent flexibility that is common in JS.

@SimonWoolf mind looking at this whilst doing your other bits?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improved functionality.
Development

No branches or pull requests

2 participants