简体   繁体   中英

How to make webpage viewable to users logged in with Parse?

I've built a homepage where users can login/register using parseSDK. That works at the moment. The second page I've made is a dashboard (dashboard.html) which should be viewable to only users that login. At the moment, anyone can do ... http://mywebsite.com/dashboard.html and see the webpage.

How can I set it up in such a way such that every time an user (not logged in at the time) goes to that URL, it will take them to index.html to login?

Check for Parse.User.current() in your javascript code. This gives you the details of current logged in user. You can redirect to index.html or dashboard.html accordingly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM