Skip to content

Conversation

@beeman
Copy link
Contributor

@beeman beeman commented Nov 23, 2016

Description

Currently the User.resetPassword method only accepts an email address as a parameter.

When you have a LoopBack application that partitions the users in Realms you need to find the user based on it's email address + realm, because it allows for 2 users with the same email address.

This PR fixes the issue by adding support for an optional realm property, that will enhance the filter used in the findOne method.

@bajtos @raymondfeng @superkhau could you please review?

Related issues

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide

@slnode
Copy link

slnode commented Nov 23, 2016

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

@slnode
Copy link

slnode commented Nov 23, 2016

Can one of the admins verify this patch?

3 similar comments
@slnode
Copy link

slnode commented Nov 23, 2016

Can one of the admins verify this patch?

@slnode
Copy link

slnode commented Nov 23, 2016

Can one of the admins verify this patch?

@slnode
Copy link

slnode commented Nov 23, 2016

Can one of the admins verify this patch?


var validCredentialsEmail = 'foo@bar.com';
var validCredentials = {email: validCredentialsEmail, password: 'bar'};
var validCredentials = {email: validCredentialsEmail, password: 'bar', realm: 'foobar'};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@beeman would this make previous test using this variable test a different thing, perhaps we should just introduce a new variable to test this feature, then we can ensure the old no realm users work fine too

@beeman
Copy link
Contributor Author

beeman commented Nov 25, 2016

@davidcheung yep makes sense, I'll update the tests.

@beeman
Copy link
Contributor Author

beeman commented Nov 27, 2016

@davidcheung I've updated the tests as per your suggestion.

Please let me know if you have any more comments.

@davidcheung davidcheung self-assigned this Nov 28, 2016
@davidcheung
Copy link
Contributor

davidcheung commented Nov 28, 2016

@slnode test please
@slnode ok to test

@davidcheung
Copy link
Contributor

Thanks @beeman for the contribution! the change LGTM, can you squash the second commit?
we should also

  • forward port this to 3.x once merged

@loay can you also PTAL

@beeman beeman force-pushed the bb/password-reset-realms branch from e973c6d to bc4b5c0 Compare November 29, 2016 20:44
@beeman
Copy link
Contributor Author

beeman commented Nov 29, 2016

My pleasure @davidcheung, thanks for looking at it.

Commits have been squashed into one.

Do you want me to look at getting it into 3.x? Any special instructions for doing that or is it just a matter of getting it working in master?

@davidcheung
Copy link
Contributor

davidcheung commented Nov 29, 2016

Do you want me to look at getting it into 3.x?

Thanks! that would be amazing, yeah there shouldnt any special instructions, i would like to see if @loay has any comments before we proceed though then we dont need to apply changes in 2 places.

@loay
Copy link
Contributor

loay commented Nov 30, 2016

@davidcheung LGTM

@beeman
Copy link
Contributor Author

beeman commented Nov 30, 2016

Thanks @loay

@davidcheung I've checked the code in master and it looks like the code touched in this PR is similar in 2.x and 3.x.

What I could do is create separate PR targeting master after this is merged, as this PR targets 2.x.

@davidcheung
Copy link
Contributor

@slnode test please

@beeman
Copy link
Contributor Author

beeman commented Nov 30, 2016

I'll rebase when I'm back at my machine

@beeman beeman force-pushed the bb/password-reset-realms branch from bc4b5c0 to e7831f6 Compare November 30, 2016 21:58
@davidcheung
Copy link
Contributor

@slnode test please

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a look, the changes LGMT too.

@davidcheung
Copy link
Contributor

@slnode ok to test

@davidcheung
Copy link
Contributor

@slnode test please

@beeman
Copy link
Contributor Author

beeman commented Dec 3, 2016

I've created a PR for adding the same feature to the 3.x branch #2998.

Please let me know if there's anything more to do on either one of these PR's

@davidcheung
Copy link
Contributor

@slnode test please

@davidcheung
Copy link
Contributor

@beeman thanks!
there was some issue on CI that delayed merging of this, they are resolved now, lets see how they go this time

@beeman
Copy link
Contributor Author

beeman commented Dec 5, 2016

@davidcheung it looks like there are still a few tests failing, I don't have access to them though.

Any insights on what makes them fail?

@davidcheung
Copy link
Contributor

i believe they are unrelated to your change
@pthieu can you PTAL so we can merge

@superkhau
Copy link
Contributor

Please send a PR to downstream ignore dashboard controller/gateway-director and land that first -- then return this PR.

@superkhau
Copy link
Contributor

Storage might be related as master has always been green on ci.strongloop.com

@pthieu
Copy link

pthieu commented Dec 5, 2016

Test fails look unrelated initially but if you look at http://ci.strongloop.com/job/loopback-component-storage/, it's always been green. But if you look at https://cis-jenkins.swg-devops.com/job/ds/job/loopback-component-storage~1.x/16/console, seems like a legit fail.

From what @davidcheung says, strongloop/loopback-component-storage#179 fixes this, so that will have to land before merging this PR.

@davidcheung
Copy link
Contributor

Storage might be related as master has always been green on ci.strongloop.com

@superkhau it is passing on master here too
it is only failing on 1.x, because 1.x has always been failing https://cis-jenkins.swg-devops.com/job/ds/job/loopback-component-storage~1.x/

@davidcheung
Copy link
Contributor

@superkhau everytime we add downstream ignore to package.json, the PR will need to be rebased, and if we know we are going to ignore that build, i dont think the order of which happens matter.

@pthieu
Copy link

pthieu commented Dec 5, 2016

LGTM. Confirming fails can be ignored. Looks like they've always been failing on those specific branches. Approved for merging.

@superkhau
Copy link
Contributor

superkhau commented Dec 6, 2016

everytime we add downstream ignore to package.json, the PR will need to be rebased, and if we know we are going to ignore that build, i dont think the order of which happens matter.

@davidcheung This is really depends on the repo downstream (and whether it blocks your merge/needs override). In this case it doesn't, so the merge order doesn't matter. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants