loopback icon indicating copy to clipboard operation
loopback copied to clipboard

Loopback PUT Request turn emailVerified to "false"

Open ishansan38 opened this issue 9 years ago • 7 comments

Bug or feature request

  • [ ] Bug
  • [ ] Feature request

Description of feature (or steps to reproduce if bug)

I tried a Put request with Loopback Explorer - it turns emailVerified to false, and thats why I am unable to login user.

Link to sample repo to reproduce issue (if bug)

Expected result

Should remain True

Actual result (if bug)

Additional information (Node.js version, LoopBack version, etc)

ishansan38 avatar Dec 30 '16 06:12 ishansan38

Experiencing the same problem here. We have an admin tool that sets emailVerified to true via a pot request, but it stopped working.

rusackas avatar Jan 03 '17 19:01 rusackas

This appears to be caused by a change in v2.36.2, which is attempting to set emailVerified to false when a user changes their email address.

This should ONLY happen when the email address actually changes, not ANY time a user record is modified!

benbrown avatar Jan 04 '17 23:01 benbrown

It doesn't, this happen any change you do in the User's model. I've fixed it changing user.js at line 863: // return data.email != ctx.data.email; original return ctx.data.email && data.email != ctx.data.email; //fix

gaecer avatar Jan 05 '17 11:01 gaecer

Temporary workaround for those in need: With any PUT to the User model, you can include the existing/current email address, and it will save everything else correctly without invalidating the email.

rusackas avatar Jan 05 '17 16:01 rusackas

this bug should be fixed in #3053 or in (2.x) #3072, please ping me in this thread if issue persists to reopen. Closing now.

davidcheung avatar Jan 10 '17 21:01 davidcheung

Tomorrow I'll check this update, thanks.

Il giorno mar 10 gen 2017 alle ore 22:07 David Cheung < [email protected]> ha scritto:

Closed #3059 https://github.com/strongloop/loopback/issues/3059.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/strongloop/loopback/issues/3059#event-918175775, or mute the thread https://github.com/notifications/unsubscribe-auth/ANKEvNSDlThnEAZhdNo3mY-DAb7ZlpI4ks5rQ_L1gaJpZM4LYBsP .

-- {"name":"Gaetano Cerniglia", "email":"[email protected]", "skype":"gaetano.cerniglia", "tel":"3458161655"}

gaecer avatar Jan 10 '17 21:01 gaecer

tl;dr... was/is this an issue for loopback 3.x.x?

dancingshell avatar Jan 11 '17 05:01 dancingshell