Before I lose what little hair I have left trying to work up a plugin I figured I should ask.
I’ve tried the obvious, User, but last_seen_at is undefined.
I’ve tried combinations of hyphens, underscores, camelCase, etc. etc. with no joy.
I’ve used getOwnPropertyNames to try and drill down into various objects in hopes of finding it elsewhere.
I’ve looked at the dev console in places I’ve never looked before.
tl,dr I’ve tried a lot
I’m sure I must have danced close to the correct syntax, and I know the information has to be available somewhere, somehow, but my “educated guesses” have so far failed me.
AFAIK the property is neither “private” nor “untrusted” so I hope it can be gotten.
That seems to be equivalent to Discourse.User.current()
i.e. the same set of properties, and again last_seen_at is undefined.
My guess is because it’s a datetime data type.
Or maybe it just isn’t able to be called by a plugin in the simple ways I’ve been trying to get the value.
[quote=“Mittineague, post:3, topic:30788”]
My guess is because it’s a datetime data type. Or maybe it just isn’t able to be called by a plugin in the simple ways I’ve been trying to get the value.
[/quote]Nope, it’s just not included in the basic data included in there. Discourse.User.current().findDetails().then(function(u) { console.log(u.last_seen_at); }); is what you want.