# メンバーは他者としてログインして投稿できますか？

**URL:** https://meta.discourse.org/t/member-able-to-login-and-post-as-someone-else/95794
**Category:** WordPress
**Created:** [2018 年 8 月 28 日午前 12:57 UTC](https://meta.discourse.org/t/member-able-to-login-and-post-as-someone-else/95794 "2018-08-28T00:57:01Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![anon29908737](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon29908737](https://meta.discourse.org/u/anon29908737)
#### Post date: [2018 年 8 月 28 日午前 12:57 UTC](https://meta.discourse.org/t/member-able-to-login-and-post-as-someone-else/95794/1 "2018-08-28T00:57:01Z")

</div>

I had a member be able to login and post under another members username and password. Somehow it autopopulated because they certainly don’t know who or what their password is. And, the logout button doesn’t log them out either. How do I troubleshoot this?? I have SSO installed.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2018 年 8 月 28 日午前 1:06 UTC](https://meta.discourse.org/t/member-able-to-login-and-post-as-someone-else/95794/2 "2018-08-28T01:06:05Z")

</div>

Do you know if the user was logged into the correct account on your WordPress site before they logged into your forum? If so, then the problem may be due to your recent changes that you mention here: [https://meta.discourse.org/t/revisioning-community-customer-flow/95414](https://meta.discourse.org/t/revisioning-community-customer-flow/95414).

If [knittingtoday.com](http://knittingtoday.com) is not the same WordPress site as was used for [clubknit.knittingtoday.com](http://clubknit.knittingtoday.com), then you are going to have to login to the rails console of your Discourse site and run the command:

`SingleSignOnRecord.destroy_all`

Let me know if this doesn’t make sense, or if you have trouble getting it done.

---

<div class="post-metadata">

### Author: ![anon29908737](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon29908737](https://meta.discourse.org/u/anon29908737)
#### Post date: [2018 年 8 月 28 日午前 1:25 UTC](https://meta.discourse.org/t/member-able-to-login-and-post-as-someone-else/95794/3 "2018-08-28T01:25:55Z")

</div>

She said she had requested a password reset. I’m thinking no, she was not logged into the account beforehand. clubknit and knittingtoday each ran their own wordpress install. To run the command, do i just go the SSH console? do I change to discourse directory or anything?

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2018 年 8 月 28 日午前 1:33 UTC](https://meta.discourse.org/t/member-able-to-login-and-post-as-someone-else/95794/4 "2018-08-28T01:33:08Z")

</div>

> [@anon29908737](#):
>
> clubknit and knittingtoday each ran their own wordpress install.

This is probably the issue. Discourse users are associated with WordPress users based on the WordPress user\_id. If your new site is using a different database than your previous site, the user ids will be different.

The command you need to run to fix this is run from the Rails server of your Discourse installation. First ssh into your server, then run:

`cd /var/discourse`

then run

`./launcher enter app`

then run

`rails c`

This should bring you to the rails console. You’ll know you are there when you see a prompt that looks like this:

`>`

At that prompt, enter:

`SingleSignOnRecord.destroy_all`

---

<div class="post-metadata">

### Author: ![anon29908737](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon29908737](https://meta.discourse.org/u/anon29908737)
#### Post date: [2018 年 8 月 28 日午前 2:20 UTC](https://meta.discourse.org/t/member-able-to-login-and-post-as-someone-else/95794/5 "2018-08-28T02:20:50Z")

</div>

How do I know if its done? There is a blinking : but it only looks like it did a few records.

---

<div class="post-metadata">

### Author: ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)
#### Post date: [2018 年 8 月 28 日午前 2:27 UTC](https://meta.discourse.org/t/member-able-to-login-and-post-as-someone-else/95794/6 "2018-08-28T02:27:35Z")

</div>

First make sure that you are actually in the Rails console. (I’ve edited my instructions in the previous post.)

To check if you have deleted all the SingleSignOnRecords run the command:

`SingleSignOnRecord.all`

It should return something like this: `[]`. If instead it returns some records with data, you will know they haven’t been deleted.

While you are in the Rails console, you should probably also log out all of your users by running this command:

`UserAuthToken.destroy_all`

When this has been done, SSO should work correctly for you.

---

<div class="post-metadata">

### Author: ![anon29908737](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon29908737](https://meta.discourse.org/u/anon29908737)
#### Post date: [2018 年 8 月 28 日午前 2:51 UTC](https://meta.discourse.org/t/member-able-to-login-and-post-as-someone-else/95794/7 "2018-08-28T02:51:41Z")

</div>

Yep. When I didn’t get the \>, I did a little searching on some past messages and saw the rails login needed.

---

<div class="post-metadata">

### Author: ![anon29908737](https://avatars.discourse-cdn.com/v4/letter/a/8e7dd6/32.png) [@anon29908737](https://meta.discourse.org/u/anon29908737)
#### Post date: [2018 年 8 月 28 日午後 12:57 UTC](https://meta.discourse.org/t/member-able-to-login-and-post-as-someone-else/95794/8 "2018-08-28T12:57:56Z")

</div>

Just to wrap this up. Looks like everything worked just fine. Appreciate the help, as always @simon.

---

<div class="post-metadata">

### Author: ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)
#### Post date: [2018 年 8 月 30 日午後 10:00 UTC](https://meta.discourse.org/t/member-able-to-login-and-post-as-someone-else/95794/9 "2018-08-30T22:00:08Z")

</div>

This topic was automatically closed after 21 hours. New replies are no longer allowed.
