-
Notifications
You must be signed in to change notification settings - Fork 17
Adds a new replaceUser method to Security #208
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
Codecov Report
@@ Coverage Diff @@
## 5.x #208 +/- ##
==========================================
+ Coverage 99.41% 99.42% +<.01%
==========================================
Files 16 16
Lines 1718 1733 +15
Branches 458 465 +7
==========================================
+ Hits 1708 1723 +15
Misses 10 10
Continue to review full report at Codecov.
|
src/security/Security.js
Outdated
action = options.replaceIfExist ? 'createOrReplaceUser' : 'createUser'; | ||
if (options && options.replaceIfExist) { | ||
self.fetchUser(id, function (fetchError, fetchResult) { | ||
if (fetchResult instanceof User && options && options.replaceIfExist === true) { |
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 can reject the query here if fetchUser
return a user and options.replaceIfExist !== true
without querying kuzzle
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.
Indeed, PR updated
934fe3e
to
c8ec494
Compare
c8ec494
to
c7c2554
Compare
Linked to https://github.com/kuzzleio/kuzzle-sdk/issues/21