How to log out all members?

I need all members to be logged in, so that they create their account in memberful, how do I?

Enable memberful SSO (however that needs to be done), disable local logins, disable anonymous mode.

1 Like

I need to log out on all users, but doing one by one is tiring, can you log out all at once?

This should be enough to log out all users, with the possibility of exempting some users:

protected_users = ["system", "codinghorror"] # do not process these users

# get all users that should be logged out
affected_users = User.all.select { |u| !(protected_users.include? u.username) }

affected_users.each { |u|
        u.user_auth_tokens.destroy_all
        u.logged_out
};

This needs to be run within Rails – pasting it into a rails console (./launcher enter app, rails c) should be enough.

Better safe than sorry: Always have a backup ready before going near the Rails console.

4 Likes

Will this work with SSO as well?

Sam elsewhere suggests nuking a couple of other values as well:

1 Like