-
Feb 25th, 2020, 11:55 PM
#1
Thread Starter
PowerPoster
[RESOLVED] Disabling a web page until logging in?
I have a web page that will be used as an administrative page for a website. I want to prevent a user from using any of the functionality until they have logged in. How can this be accomplished? I'm pretty sure Javascript would work but just don't know how to accomplish this.
Thanks,
-
Feb 26th, 2020, 07:59 AM
#2
Re: Disabling a web page until logging in?
Don't use javascript for this; it should be a back-end thing.
What is your backend? Typically you would just set a session for the user when they login and check that session for a specific claim or permission. If they don't have that permission, return a 403 or an error message saying they don't have permission.
It is really a question that requires you to post code and more detail.
-
Feb 26th, 2020, 01:38 PM
#3
Re: Disabling a web page until logging in?
When my users "login" I give them a GUID (supplied from the backend code) that is used for every single AJAX post from that point forward. That's more for security...
As for UX (user experience), you should not DISPLAY parts of the page that are not for consumption until they successfully login. That way it's intuitive to the user what is available prior to login and after login.
My 2 cents
-
Feb 26th, 2020, 07:53 PM
#4
Thread Starter
PowerPoster
Re: Disabling a web page until logging in?
Thanks smitty...that helped...and it makes sense as well.
-
Feb 28th, 2020, 03:52 AM
#5
Re: Disabling a web page until logging in?
For admin functionality in our apps you just dont see the admin menu options unless you have logged in as an Admin they are hidden.
You get a different view based upon your UserRole.
Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you
-
Mar 18th, 2020, 11:18 PM
#6
Member
Re: Disabling a web page until logging in?
hello..
You Can try Session if user login success than set the session and check condition session is set or not if session is set than other code run other wise send warning.
< advertising removed by moderator >
-
Mar 18th, 2020, 11:19 PM
#7
Member
Re: Disabling a web page until logging in?
hello..
You Can try Session if user login success than set the session and check condition session is set or not if session is set than other code run other wise send warning.
Last edited by Siddhi Patel; Mar 18th, 2020 at 11:22 PM.
< advertising removed by moderator >
-
Mar 18th, 2020, 11:57 PM
#8
Thread Starter
PowerPoster
Re: Disabling a web page until logging in?
Thank you Siddhi...that worked!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|