-
Notifications
You must be signed in to change notification settings - Fork 303
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
Added support for client credentials flow #133
Conversation
22528ab
to
0e8ca35
Compare
@@ -28,6 +30,8 @@ var OAuthAuthenticator = function (options) { | |||
|
|||
this.oauth = new RestClient(oauthUrl); | |||
this.clientId = options.clientId; | |||
this.clientSecret = options.clientSecret; | |||
this.domain = options.domain; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where is the domain used? not familiar with the code base, but no change in the PR seems to be using it. if it is in this.oauth
then 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
forgot to remove that. I made it different at first
it('should perform a POST request to ' + path, function (done) { | ||
var request = this.request; | ||
|
||
this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can return the promise and avoid calling done()
inside then
.
I would not add catch(done)
. If this results in an error, the test should not pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
0e8ca35
to
3fd2466
Compare
.authenticator | ||
.clientCredentialsGrant(options) | ||
.then(done.bind(null, null)) | ||
.catch(done.bind(null, null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the operation fails the test should not pass, remove the catch. you can return the promise directly, remove the done
parameter and the then
call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right, we should check the rest of the tests then
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
}) | ||
.reply(200); | ||
|
||
this |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for all of these, same thing: return the promise and don't handle the catch, no need for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
No description provided.