search

Home  >  Q&A  >  body text

angular.js - How does Angular prevent users from accessing pages through addresses without logging in?

For the designed page, you must log in first before you can use the functions on the page. If you are not logged in, is it possible to enter the page directly through the address link?

巴扎黑巴扎黑2824 days ago789

reply all(3)I'll reply

  • ringa_lee

    ringa_lee2017-05-27 17:46:25

    Actually, when entering each page, you should check whether you need to log in and whether you have logged in. If not, jump to the login page.

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-27 17:46:25

    Verification is performed uniformly at the router location. Before the router jumps, it determines whether you are logged in. If you are not logged in, jump to the login page

    reply
    0
  • 曾经蜡笔没有小新

    曾经蜡笔没有小新2017-05-27 17:46:25

    If it is an architecture with completely separated front-end and back-end: When the user opens the page for the first time, he first goes to the back-end to obtain the user information (to determine whether to log in);
    As for the login verification method: Normally, after successful login, a cookie will be stuffed. a session. The browser will automatically bring this cookie every time it sends a request to the backend. Another verification method is a custom token.
    In other words, requests for front-end and back-end data interaction are all back-end verification cookies or tokens, and do not require front-end verification.

    reply
    0
  • Cancelreply