Fixed up user login logic and works now, now to clean up the user data.
This commit is contained in:
@@ -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 () {
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user