updated auth to work with new sessions on api
This commit is contained in:
parent
161cac42f1
commit
3ae20e06da
@ -33,9 +33,9 @@ daddy.controller("loginCtrlr", function($scope, $cookies, $location, $http, stat
|
||||
let today = new Date()
|
||||
let expired = new Date(today)
|
||||
expired.setDate(today.getDate()+1)
|
||||
$cookies.putObject('user', res.data[0], {expires : expired})
|
||||
$cookies.putObject('user', res.data, {expires : expired})
|
||||
console.log("set cookie")
|
||||
stateData.setUser(res.data[0])
|
||||
stateData.setUser(res.data)
|
||||
console.log("set data")
|
||||
stateData.setPage("forum")
|
||||
$location.path("/")
|
||||
@ -45,6 +45,7 @@ daddy.controller("loginCtrlr", function($scope, $cookies, $location, $http, stat
|
||||
$scope.loginStatus = "Incorrect information!"
|
||||
console.log("request denied")
|
||||
} else if (res.status == 500) {
|
||||
$scope.loginStatus = "Login Failed."
|
||||
console.log("something went wrong: " + res)
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user