add auth Service with API authentication url
authorrougeronj
Thu, 02 Apr 2015 11:58:19 +0200
changeset 52 ce9aefce6e41
parent 51 032280909e65
child 53 dac1df90b49e
add auth Service with API authentication url
client/app/app.js
--- a/client/app/app.js	Thu Apr 02 11:57:39 2015 +0200
+++ b/client/app/app.js	Thu Apr 02 11:58:19 2015 +0200
@@ -109,6 +109,12 @@
         	data.video = $sce.trustAsResourceUrl(data.video);
         	return data;
         };
-    });
+    })
+  .service('authApi', function($resource, context) {
+	  this.login = $resource(context.urls.ammicoUrl+'/auth/api-token-auth');
+	  this.logout = $resource(context.urls.ammicoUrl+'/auth/logout');
+	  this.user = $resource(context.urls.ammicoUrl+'/auth/user');
+	  this.test = $resource(context.urls.ammicoUrl+'/auth/auth');
+  });
 
 })();