Is it possible to check the login-state of a client?

Hi glitchers,

I would like my app to be able to check whether a client is logged in on glitch.com or not, is that by any chance possible?

Cheers, Ida

I imagine that your first response will be a question so let me ask it. What do you mean? Client as in someone you work with, a team member, someone using your site, something else?

There’s no official single-sign-on kind of system. I think currently Glitch intends not to share the user identity with sites hosted on Glitch.

See here for an unofficial login system.

3 Likes

That’s an interesting approach. Probably won’t go for it, but thanks for pointing it out!

With client I mean something or someone sending requests to a glitch-site.

I am guessing you have a purpose in mind but I’m trying to understand that you are hoping that if I log into my Glitch account your software would be notified? Llike, “logged in” and then details about which actions were taken and when I log out?

That won’t happen I’m sure but what were you hoping to do with the information?

Nope, just need a possibility to check whether a user is authenticated or not.

For example to give access to a site only for certain persons.

I sort of think I understand but not quite :slight_smile: Not that I have to understand it but someone might have a solution. You have a website hosted on Glitch that you want only some people to be able to use? How is this different from other sites that require a log-in?

Don’t you have them log-in and save a token? I thought you wanted to know if the person was “logged in” to their account on Glitch.

Hi @ida, welcome to the forum :blush:

It’s a neat idea, I don’t think there’s an easy answer, unfortunately. I have thought to myself “it would be cool if I could see if the user had an active Glitch cookie so that I could customise the page for them” but glitch.com and glitch.me are at separate URLs specifically so that user apps can’t read the cookies and security stuff belonging to the current user! Sad!

I think perhaps the OP’s idea here is that, if they could see that the site visitor is currently logged into Glitch, they would get this functionality “for free” :slight_smile:

Yupp, you got me :blush: Already suspected it’s not possible, was hoping maybe the inofficial API could have a method for that, but thanks everybody for the kind support!

1 Like

Hi @SteGriff. Personally I would (I think) “never” set something up with this sort of dependency. Am I asking my users to log into a Glitch account (I assume they have) before accessing my website? Or what happens when they get to my website first?

And if they don’t have a Glitch account and if I decide to no longer host it on Glitch?

In any case it seems academic at this point.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.