Staged users remain staged even after activation and must be manually unstaged

This is similar to:

except that when a user is staged, meaning that it came in via email in, and after their account is activated (either by the admin or by sending out an activation email which they reacted to), they can log into the system and do things like a regular user.

Except that they user account stays staged. There is no way to clear the staged flag.

So, user needs to be automatically unstaged not only when loggin in via OAuth, but simply when they are activated via any means.

3 Likes

What do you think @zogstrip?

Just in case other people needs to manually unstage a user:

Step 0: SSH to your VM

ssh my.discourse.domain.com

Step 1: Enter the discourse container

cd /var/discourse
sudo ./launcher enter app

Step 2: Enter the Rails console

rails c

Step 3, Option 1: Unstage the user by email address

User.find_by_email("email@address.com").update(staged: false)

Step 3, Option 2: Unstage the user by username

User.where(username: "username").update_all(staged: false)

Step 4: Finito, get out

Press ^D a few times to get back out.

13 Likes

@schungx

Is this still accurate? I was trying to do this and keep getting: undefined method `update" for nil:NilClass

AFAIK this is still true.

If you got a nil error on update, then it is likely that you mis-typed the email address. User.find_by_email didn’t find it and so returned nil.

3 Likes

Anyone in team gonna take a look at this?
It seems to be still not fixed.

We’ll now always unstage user when they log in :banana:

https://github.com/discourse/discourse/commit/2cf6fb7359a8ad6ea9ee7b33ce645eece50ece44

8 Likes

Great. This is a great help.

There is one more issue. For staged uses, pressing the Send Activation Email button doesn’t send the email. The email logs show that the signup email has been sent, but the email is actually not sent.

I wonder if it is filtered out somewhere.

Just tried and it worked fine. Was your sidekiq queue full?

2 Likes

Not really… It is just that the email is not sent, but it says sent in under Email->Sent.

Sidekiq not full.

The only way I get to invite staged people right now is 1) Activate them by hand, 2) Press Send Password Reset email.

Have you checked the logs of your SMTP provider/API?

I’ll go do some more digging around after I upgrade to the latest and greatest.

It is strange that the Password Reset email got sent IMMEDIATELY, while the activation emails don’t ever get sent/received.