how to restrict access to weekends ?

hello, I’m building a saas project but I need users to not have access to the system on the weekend “Saturday and Sunday” how can I make this restriction?

hi @contato53, and welcome to the community!
you can do that by checking the current date on login and on homescreen.

On login:
allow login only if the date doesn’t fall on a Saturday or Sunday, show an alert when a user tries to login on the weekend to avoid user frustration.

On homepage (if users were already logged in)
log the user out on pageload if the date falls on a Saturday or Sunday.

image

I still feel this way may not be the best, though :sweat_smile: :sweat_smile: so if anyone has a better way please share!

2 Likes

It worked perfectly, thank you very much for your help.

1 Like

you’re welcome :slight_smile:

This topic was automatically closed after 70 days. New replies are no longer allowed.