From 3ae20e06da1ec605dce1f570bbe03f8c795061d1 Mon Sep 17 00:00:00 2001 From: inkletblot Date: Fri, 14 Feb 2020 11:23:59 +1030 Subject: [PATCH] updated auth to work with new sessions on api --- scripts/auth.controllers.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/auth.controllers.js b/scripts/auth.controllers.js index a42a893..4bff817 100644 --- a/scripts/auth.controllers.js +++ b/scripts/auth.controllers.js @@ -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) } })