简体   繁体   中英

AngularJS Login example - amending for server authentication

I'm having trouble changing Valerio Coltrè's github - angular login example to work with my ServiceStack authentication.

I really like the authentication implementation Valerio has produced but he is using an httpBackend mock and intercepting the API GET and POST requests. No matter what I've tried I cannot get it to play nicely with my ServiceStack API hosted at /api .

Has anyone done this before and got Valerio's solution to play nice with a REST service?

I've resolved the problem but thought it worthwhile not deleting the question in case others have the same problem. Also I do recommend others check out Valerio's solution if anyone is looking for an angular authentication scaffold.

The answer kind of came to me whilst I posted the question: I just removed the httpBackend factory and it's associated configuration as well as removed the injection of angular-login.mock. It then stopped intercepting the http traffic and I was able to start authenticating against my web services.

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