0
I’m doing an application and now that it’s almost complete I was testing the attacks. I realized that with ngRoute routes the application is vulnerable to url entries.
For example, the application starts redirecting to the login page, but if I go to the url and type the name of a specific page, it enters without logging in. Thanks to the token, the user cannot make any interaction with the application, but still he has access to content that does not request the back.
My situation, I searched the internet and found something about an attribute in the called Angularjs resolves. I tried to implement it, but without success. The question, is there any way in Angularjs to block all routes for those who are not logged in? If yes, how?
This Authorize: true , serves to block by hierarchy right? I will test this form, thanks for the answer beast.
– Ever
Vlw ai fera, but it didn’t work. I can still access other pages via url without being logged in.
– Ever
that
authorize: true
adds a parameter calledauthorize
with true value the route. This value is recovered in the methodpreAtivador
inif (next.authorize)
, if the attribute is set it enters that if.– Lucas Duete
in my case I have an object in
LocalStorage
calledtoken
, this is an access token that the user receives when logging in. If you use another form of login and access you can do,:localStorage.logado = true
hence replace thelocalStorage.token
forlocalStorage.logado
– Lucas Duete
Vlw man, I’m going to test it now. I use token to validate login, hopefully it’s easy to implement and functional this localStorage.token = true ^^
– Ever