How to change email via API?
-
Hello there,
I am late to the party finally upgrading from 1.19 to 3.x.
My board is using a custom OAuth2 login and needs syncing username and email changes into NodeBB. So far I was using the write-api plugin (PUT /api/v2/users/<id>) which is deprecated now.The API docs don´t show that username or email can be changed. But via testing I figured out that username change is working fine.
But I had no success on changing the email. Is there any way to do so?(Additional info: I am using the master token and impersonate the board admin with user id 1)
Might also relate to an earlier unanswered question here.
-
Ok so I debugged the code and figure out that instead of updating the email it sends out a validation email
NodeBB/src/user/profile.js at 0e4fc531e006c3dd2c5fa402e90b20309cc3a1e6 · NodeBB/NodeBB
Node.js based forum software built for the modern web - NodeBB/src/user/profile.js at 0e4fc531e006c3dd2c5fa402e90b20309cc3a1e6 · NodeBB/NodeBB
GitHub (github.com)
Unfortunately that's a huge step backwards for me, as the user already verified his new email in the system that triggers the email change in NodeBB
-
That works. Thank you!
-