Discourse User Created Response Not as expected

Discourse returning

You’re almost done! We sent an activation mail to abc@gmail.com. Please follow the instructions in the mail to activate your account.

If it doesn’t arrive, check your spam folder.

as message even when the email id exists. I have done changes in the code, I hardcoded the activation message in create method in userController as “User Activated”. Even then the message comes as above. Can anyone help?

Sorry, I don’t understand what you have written?

I will tell you in detail.

So our requirements are : We have to register bulk users from our DB to discourse. So, we can’t allow users to activate their discourse account via email as we do that via firebase on our webapp.

So, I did some research on discourse code and I commented out the part in userController : activate function which sends email and activated the user there itself so that it was returning the following response :

    success: true,
    active: true,
    message: "User activated",
    user_id: user.id

But from yesterday, I started getting this response below :

success: true,
active: false,
message: ‘You’re almost done! We sent an activation mail to abc@gmail.com. Please follow the instructions in the mail to activate your account.If it doesn’t arrive, check your spam folder’

How can I check my user register API is hitting the create function or is there some type of caching which is causing me this trouble.

Unless you are making the changes in a plugin, updating Discourse will overwrite any changes you make to the Discourse code. Could this be what has happened?

1 Like

Which plugin you are talking about? The only changes I made was in users_controller in discourse code? Can you just help me with the code. I want to debug is using the code. Just let me know where the routes are for user sign up. "/u" or "/u.json" to be precise.

Also, If I log something on userController using print, will I be able to see the log on terminal, right now I am unable to.

I got the issue. I wasn’t sending the correct password_confirmation and challenge from my payload and it was declaring it as suspicious request. I have made the required changes and its working now. But what is the logic behind these two params as they keep on changing.