angular.module('starter.services.Auth', [])

.factory('Auth', function($localForage, $window,$http,Util) {
	var Auth = {
		isAuth:function(){
			return $window.localStorage.getItem('auth')==='true';
		},
		setAuth:function(){
			$window.localStorage.setItem('auth','true');
		},
		setUnauth:function(){
			$window.localStorage.setItem('auth','false');
		},
		register:function(username,email,password){
			var registerForm={
				username:username,
				password:CryptoJS.MD5(password).toString(),
				
			};
			registerForm.username=username;
			registerForm.password=CryptoJS.MD5(password).toString();
			registerForm.email=email;

			return $http.get('/register',{
				params:registerForm
			}).then(function(result){
				return result.data;
			});
		},
		login:function(email,password){
			var loginForm={
				email:email,
				password:CryptoJS.MD5(password).toString()
			};
			return $http.get('/login',{
				params:loginForm
			}).then(function(result){
				return result.data;
			});
		},
		logout:function(){
			return $http.get('/logout').then(function(result){
				return result.data;
			});
		}

	}
	return Auth;
});
@@ -637,26 +637,27 @@
 eturn $http.
-ge
+pos
 t('/register
@@ -658,29 +658,16 @@
 gister',
-%7B%0A%09%09%09%09params:
 register
@@ -666,29 +666,24 @@
 registerForm
-%0A%09%09%09%7D
 ).then(funct
@@ -887,21 +887,8 @@
 in',
-%7B%0A%09%09%09%09params:
 logi
@@ -892,21 +892,16 @@
 oginForm
-%0A%09%09%09%7D
 ).then(f

use post