# "Last seen" time bumped when suspended user attempts login via social logins

**URL:** <https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567>\
**Category:** Bug\
**Created:** [2017年十二月7日 01:49 UTC](https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567 "2017-12-07T01:49:13Z")\
**Posts on this page:** 12\
**Page:** 1

<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:** [2017年十二月7日 01:49 UTC](https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567/1 "2017-12-07T01:49:13Z")

</div>

A suspended user cannot login to the Discourse site. If a user attempts to login to a site with their username and password, they’re denied access. The user’s “last seen” time is not modified.

However, if a suspended user attempts to log in with a social login (Google, Facebook, etc.), the “last seen” time is bumped to the current time, despite the user being denied access. This is inconsistent and would be nice to fix.

---

<div class="post-metadata">

**Author:** ![cpradio](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/cpradio/32/4970_2.png) [@cpradio](https://meta.discourse.org/u/cpradio)\
**Post date:** [2017年十二月7日 11:08 UTC](https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567/2 "2017-12-07T11:08:40Z")

</div>

I believe this happens with SSO too. @TechnoBear and @Mittineague can you confirm this is what you were looking into?

---

<div class="post-metadata">

**Author:** ![Mittineague](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mittineague/32/114259_2.png) [@Mittineague](https://meta.discourse.org/u/Mittineague)\
**Post date:** [2017年十二月7日 15:49 UTC](https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567/3 "2017-12-07T15:49:28Z")

</div>

That’s what I had noticed. IIRC, we concluded that it was most likely peculiar to SitePoint Premium handling the login process and not a core Discourse issue.

That is, if a member had been suspended in the forum, they should still be able to access their Premium account, and when they logged in to Premium the event was sent to the forum anyway.

My guess is that the login modal (screen in SitePoints case) was updating the last seen at the beginning of the log in process instead of on its success. But I haven’t looked at the code involved yet so I don’t really know.

---

<div class="post-metadata">

**Author:** ![TechnoBear](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/technobear/32/40546_2.png) [@TechnoBear](https://meta.discourse.org/u/TechnoBear)\
**Post date:** [2017年十二月9日 15:42 UTC](https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567/4 "2017-12-09T15:42:29Z")

</div>

> [@Mittineague](#):
>
> That is, if a member had been suspended in the forum, they should still be able to access their Premium account, and when they logged in to Premium the event was sent to the forum anyway.

That’s not quite what was happening. Any member - suspended or otherwise - can log into their Premium account, and it doesn’t register on the forum “last seen” time; only an actual log-in or attempted log-in at the forums does that.

A suspended account making a log-in attempt at the forums will register an updated “last seen” time and a new “Last IP address” (if different), even though they never reached the forums.

We also established that suspended members were unable to log in, but were **not** shown any message stating their account was suspended. We have no way of testing whether this is simply a problem with our own set-up, or a wider issue with SSO.

---

<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:** [2017年十二月9日 16:47 UTC](https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567/5 "2017-12-09T16:47:23Z")

</div>

> [@TechnoBear](#):
>
> We also established that suspended members were unable to log in, but were not shown any message stating their account was suspended.

I’m fairly certain this was fixed for SSO. Perhaps @eviltrout can clarify?

---

<div class="post-metadata">

**Author:** ![TechnoBear](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/technobear/32/40546_2.png) [@TechnoBear](https://meta.discourse.org/u/TechnoBear)\
**Post date:** [2017年十二月10日 14:38 UTC](https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567/6 "2017-12-10T14:38:12Z")

</div>

Thank you.

We’re still on an older version of Discourse, so perhaps an upgrade will fix that particular issue.

---

<div class="post-metadata">

**Author:** ![eviltrout](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviltrout/32/5275_2.png) [@eviltrout](https://meta.discourse.org/u/eviltrout)\
**Post date:** [2017年十二月12日 17:05 UTC](https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567/7 "2017-12-12T17:05:49Z")

</div>

I did not change it for SSO, although it’s possible another change did fix it? Someone would have to confirm it is working.

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2018年四月23日 00:22 UTC](https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567/8 "2018-04-23T00:22:59Z")

</div>

Is this still a problem or can this be closed?

---

<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年四月27日 22:10 UTC](https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567/11 "2018-04-27T22:10:27Z")

</div>

I can no longer reproduce this with Google login, but Facebook login when suspended does still bump the “last seen” time.

---

<div class="post-metadata">

**Author:** ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)\
**Post date:** [2018年七月18日 05:32 UTC](https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567/12 "2018-07-18T05:32:45Z")

</div>

Oh, @david since you are all over this login flow can you review this use case and correct it?

---

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [2018年七月18日 15:06 UTC](https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567/14 "2018-07-18T15:06:30Z")

</div>

Added test case and fixed:

[https://github.com/discourse/discourse/commit/2dc3a50dacb2aa699b0c68c9abf8fcc5436dc81b](https://github.com/discourse/discourse/commit/2dc3a50dacb2aa699b0c68c9abf8fcc5436dc81b)

---

<div class="post-metadata">

**Author:** ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)\
**Post date:** [2018年七月19日 17:00 UTC](https://meta.discourse.org/t/last-seen-time-bumped-when-suspended-user-attempts-login-via-social-logins/75567/15 "2018-07-19T17:00:03Z")

</div>

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