Question

Is it possible to show a login prompt?

  • 1 March 2021
  • 1 reply
  • 74 views

Hello, first post here! _o/

So, my team and I are trying to figure out how to achieve this.

We need to show a login prompt to the user in case they are not logged in, accessing the home page. We are going to apply some time interval to show it and also we might use some localStorage to control if the user has previously closed this prompt.

I found another post kind related with what I need, but it seems it didn’t have a solution:

https://community.insided.com/got-a-question-38/is-there-a-way-to-add-a-pop-up-to-prompt-community-sign-ups-2195?postid=8191#post8191
 

Basicly the process would be like this:

  • User access the home page
  • We check if the user is logged in
  • If not, set the timer 
  • Show the login prompt

Thanks in advance :)


1 reply

Badge

Howdy @italo.borges !

I’ve tried to have a bit of a look through the page source as a logged out user, and I did find the modal. If you view the source for this page while logged out, it’s around roughly lines 800 to 1,200-ish as I write this comment - but it might get bumped a bit by me posting this. The easiest way to find it otherwise, would be to search for something like Please enter your username and password that you know appears in the modal (based off of the one for InSpired).

It also seems to be fired by some kind of JavaScript that I’ve not yet managed to track down. It seems as if that JS basically pulls up community.insided.com/member/login via some clever trick that means it doesn’t require any further network requests (probably preloaded), which might explain why I couldn’t track it down. But unlike the dedicated page, the modal also lets you close it

Just some random thoughts here. I have a feeling that to get this to work could be as simple as firing the JS if specific conditions are met, similar to how it fires on-click. using LocalStorage might be a bit overkill though. This sounds like something a cookie could do - something like dismissedLogin with a value of 0 allowing the auto-trigger to run (on the basis the user hasn’t seen it yet), or 1 blocking it from running at all (on the basis the user has already dismissed the prompt, so I don’t want to nag them again). I guess you could also make it so that the cookie is only set after the user dismisses the prompt, so that you’re not setting cookies that aren’t helpful, and if it is set, make it expire after a year or so.

In terms of transparency, Cookies also tend to be a little bit better than LocalStorage as well. :wink:

Given that inSided might change this sort of thing from time to time though, there’s a risk that if you try to build this yourself, it could break if the login system is updated down the road. It’s probably easiest done on their end so that it can be maintained more easily. And it would probably also make it easier for folks to turn the feature on/off as well, without needing to dig into the code.

It’s also a bit unlucky for me that I don’t have permissions to access the Ideation features on InSpired, so I can’t check to see if there’s any Ideas post. Admittedly, that’s an oversight on my part, as I forgot that it’s a private area that you need approval to get into! That might be because inSided can’t verify that I’m a customer though, which is technically true.

I wonder if @tom.shaddock might know more on this?

Reply