Fixed up user login logic and works now, now to clean up the user data.

This commit is contained in:
Shannon
2013-06-17 05:34:30 +02:00
parent c52e51b2d8
commit 88b84c5bcf
5 changed files with 9 additions and 9 deletions

View File

@@ -84,8 +84,8 @@ angular.module('umbraco').controller("MainController",
//set properties
$scope.authenticated = userService.authenticated;
$scope.login = "Hello";
$scope.password = "World";
$scope.login = "";
$scope.password = "";
$scope.signin = function () {

View File

@@ -6,8 +6,8 @@
function authResource($q, $http, umbDataFormatter, umbRequestHelper) {
/** internal method to get the api url */
function getLoginUrl() {
return Umbraco.Sys.ServerVariables.authenticationApiBaseUrl + "PostLogin";
function getLoginUrl(username, password) {
return Umbraco.Sys.ServerVariables.authenticationApiBaseUrl + "PostLogin?username=" + username + "&password=" + password;
}
@@ -16,7 +16,7 @@ function authResource($q, $http, umbDataFormatter, umbRequestHelper) {
var deferred = $q.defer();
//send the data
$http.post(getLoginUrl(), {username: username, password: password}).
$http.post(getLoginUrl(username, password)).
success(function (data, status, headers, config) {
deferred.resolve(data);

View File

@@ -40,7 +40,7 @@ angular.module('umbraco.services')
logout: function () {
$rootScope.$apply(function () {
authenticated = false;
jQuery.cookie('authed', null);
jQuery.cookie('UMB_UCONTEXT', null);
currentUser = undefined;
});
},