-
Notifications
You must be signed in to change notification settings - Fork 17
SDK refactor: Auth controller #288
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
Conversation
# Conflicts: # src/Kuzzle.js # src/networkWrapper/protocols/abstract/realtime.js # test/network/offlineQueue.test.js # test/network/query.test.js
Codecov Report
@@ Coverage Diff @@
## 6.x #288 +/- ##
==========================================
+ Coverage 80.27% 84.13% +3.85%
==========================================
Files 19 20 +1
Lines 2023 1973 -50
==========================================
+ Hits 1624 1660 +36
+ Misses 399 313 -86
Continue to review full report at Codecov.
|
Note: to help the code review and concentrate only on |
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.
except of my comments above about query promise, and a small nitpicking about signature of login
method, it's OK for me.
src/Auth.js
Outdated
* @param expiresIn | ||
* @returns {Promise|*|PromiseLike<T>|Promise<T>} | ||
*/ | ||
login(strategy, ...args) { |
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.
We should avoid implicit arguments, and use better an explicit signature:
login(strategy, credentials, expiresIn)
If we need to call login
without credentials, just call login(strategy, null, expiresIn)
Added the auth controller with the following method:
Merge the branch feature/query-pormise so query returns promise