简体   繁体   中英

can users bypass restrictions to certain routes or pages in a vue.js application since all the code is rendered on the client side?

when building single page app with, for example, firebase, are the api keys used, not visible to the user since all the code is rendered on the client side? And also,since user is restricted to which routes or pages they can visit depending on the conditions set in the code, is it not possible for them to bypass or change the code since everything is on the client side?

Although it is correct that the code is client-side in an SPA, restrictions for accessing pages can still be set in place.

VueJS exposes several lifecycle hooks even before elements have been added to the DOM. In this space, you can make a network request to an authentication service. In your request, you would send a token (rf: jwt ).

await the response and you can redirect users to the login page, or continue with the component mount.

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