tag:blogger.com,1999:blog-1179473529409580853.post646955400574072770..comments2024-02-02T10:16:36.942+01:00Comments on Erratic software development: Angular ngRoute routing authorization with asychronous promisesRoberthttp://www.blogger.com/profile/16847404771942651365noreply@blogger.comBlogger12125tag:blogger.com,1999:blog-1179473529409580853.post-81886140616521814762021-09-20T07:26:39.370+02:002021-09-20T07:26:39.370+02:00I think this is one of the most significant inform...I think this is one of the most significant information for me. And i’m glad reading your article. Keep it up. Anonymoushttps://www.blogger.com/profile/09559708634847954570noreply@blogger.comtag:blogger.com,1999:blog-1179473529409580853.post-64260238623459301702020-02-20T10:32:52.326+01:002020-02-20T10:32:52.326+01:00great post thanks for sharinggreat post thanks for sharingKalyx Networkhttps://www.blogger.com/profile/10399873196442444852noreply@blogger.comtag:blogger.com,1999:blog-1179473529409580853.post-43093852093989470912018-03-08T15:55:49.201+01:002018-03-08T15:55:49.201+01:00ui-router states resolve property cannot be set as...ui-router states resolve property cannot be set as variable like in your tutorial:<br />to.resolve.authorizationResolver = function(authService) ...<br /><br />https://github.com/angular-ui/ui-router/issues/1165<br /><br />transitions should be used, but I can't make it workAnonymoushttps://www.blogger.com/profile/10018211882081547713noreply@blogger.comtag:blogger.com,1999:blog-1179473529409580853.post-86418901297808327132017-02-21T12:28:10.541+01:002017-02-21T12:28:10.541+01:00> "There's also one much greater probl...> "There's also one much greater problem with upper technique<br />> that you should be aware of. Authorized route resolution is<br />> taking place even on unauthorized route requests. And that<br />> is particularly problematic, because authorization-secured<br />> route controller gets instantiated possibly making some<br />> server resource requests in the process."<br /><br />That was my problem. The home page was firing requests to<br />get all the stuff I want to display there. Thank you for<br />teaching the solution to this. Throwing an error did the<br />trick, though it seems a little like throwing the baby<br />out with the bathwater. Wow, client side routing sucks.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1179473529409580853.post-44615917379912362792017-01-26T17:49:34.387+01:002017-01-26T17:49:34.387+01:00My homepage components were all firing their respe...My homepage components were all firing their respective ajax requests when landing on the root url before the router redirected to login. I was doing everything with promises and didn't think of throwing an Error. I was just rejecting the promise thinking that a rejected promise would prevent the controller from getting instantiated at all. It makes sense to me that it would do that... anyway, thanks!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1179473529409580853.post-62702473123057848642017-01-20T06:59:03.360+01:002017-01-20T06:59:03.360+01:00Hi,
Useful but your code is not minifcation safe e...Hi,<br />Useful but your code is not minifcation safe even when using ng-annotate. To make it safe make the following changes:<br />to.resolve.authorizationResolver = ['authService', function(authService) {<br /> console.log("Resolving authorization.");<br /> return authService.authorize();<br />}];Anonymoushttps://www.blogger.com/profile/07834439497829235184noreply@blogger.comtag:blogger.com,1999:blog-1179473529409580853.post-41567451310255998772016-09-06T04:10:25.095+02:002016-09-06T04:10:25.095+02:00thank you! it was very useful! thank you! it was very useful! Anonymoushttps://www.blogger.com/profile/14015947398448861619noreply@blogger.comtag:blogger.com,1999:blog-1179473529409580853.post-61287077976852147502016-05-31T11:35:51.657+02:002016-05-31T11:35:51.657+02:00Thank you, Robert!!
Your post helped me solve the ...Thank you, Robert!!<br />Your post helped me solve the issue i had with authorization.Ravi Jariwalahttps://www.blogger.com/profile/14934994920295175273noreply@blogger.comtag:blogger.com,1999:blog-1179473529409580853.post-20270427901865014942016-04-05T08:29:18.579+02:002016-04-05T08:29:18.579+02:00getInfo() in this case is just a simulation of an ...getInfo() in this case is just a simulation of an async server call. It's a proof of concept of asynchronous authentication during routing phase. Hence I've written it as a 1s async timeout. Async call should return much quicker though in order for your app to keep performance. :)Roberthttps://www.blogger.com/profile/16847404771942651365noreply@blogger.comtag:blogger.com,1999:blog-1179473529409580853.post-48758518281488199912016-02-04T05:49:55.731+01:002016-02-04T05:49:55.731+01:00Why is it necessary to call getInfo with a 1s dela...Why is it necessary to call getInfo with a 1s delay instead of evaluating authenticated right away? Can't quite figure that out. Thanks for this: simple, centralized, and effective. Was able to extend it for authorizing elements, too.jimhttps://www.blogger.com/profile/01492470561495564953noreply@blogger.comtag:blogger.com,1999:blog-1179473529409580853.post-63318069471432039472016-01-20T15:30:29.934+01:002016-01-20T15:30:29.934+01:00How'd it go?How'd it go?Roberthttps://www.blogger.com/profile/16847404771942651365noreply@blogger.comtag:blogger.com,1999:blog-1179473529409580853.post-4868066866144424302016-01-13T02:09:08.841+01:002016-01-13T02:09:08.841+01:00Hey going to give this a shot with UI-Router, just...Hey going to give this a shot with UI-Router, just wanted to thank you in advance incase I forget to show my results. Anonymoushttps://www.blogger.com/profile/03507618359805541123noreply@blogger.com