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 today = new Date()
|
||||||
let expired = new Date(today)
|
let expired = new Date(today)
|
||||||
expired.setDate(today.getDate()+1)
|
expired.setDate(today.getDate()+1)
|
||||||
$cookies.putObject('user', res.data[0], {expires : expired})
|
$cookies.putObject('user', res.data, {expires : expired})
|
||||||
console.log("set cookie")
|
console.log("set cookie")
|
||||||
stateData.setUser(res.data[0])
|
stateData.setUser(res.data)
|
||||||
console.log("set data")
|
console.log("set data")
|
||||||
stateData.setPage("forum")
|
stateData.setPage("forum")
|
||||||
$location.path("/")
|
$location.path("/")
|
||||||
@ -45,6 +45,7 @@ daddy.controller("loginCtrlr", function($scope, $cookies, $location, $http, stat
|
|||||||
$scope.loginStatus = "Incorrect information!"
|
$scope.loginStatus = "Incorrect information!"
|
||||||
console.log("request denied")
|
console.log("request denied")
|
||||||
} else if (res.status == 500) {
|
} else if (res.status == 500) {
|
||||||
|
$scope.loginStatus = "Login Failed."
|
||||||
console.log("something went wrong: " + res)
|
console.log("something went wrong: " + res)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user