Currently, I am tackling the challenge of implementing JWT authentication using Angular and Java Jersey. I have successfully managed to send the JWT token from the server to the client, which can be observed as a POST response with a status code of 200 in the Chrome console.
However, my hurdle lies in storing the token in a variable for decoding purposes. Whenever I attempt to save it, an error crops up:
TypeError: href is null
e/<()angular.min.js (line 107)
Ze/this.$get</<()angular.min.js (line 81)
f/<()angular.min.js (line 119)
lf/this.$get</r.prototype.$eval()angular.min.js (line 133)
lf/this.$get</r.prototype.$digest()angular.min.js (line 130)
lf/this.$get</r.prototype.$apply()angular.min.js (line 134)
g()angular.min.js (line 87)
T()angular.min.js (line 92)
Uf/</w.onload()angular.min.js (line 93)
stackFrame.js (line 357)
<System>
error is:undefined
Take a look at the snippet of my code below:
myApp.controller('loginController', ['$scope', '$http', function ($scope, $http) {
$scope.email = "";
$scope.password = "";
$scope.loginForm = function () {
var data = {email: $scope.email, password: $scope.password};
var url = 'rs/loginResource';
$http.post(url, data).success(function (response) {
console.log("token is: " + response);
}).error(function (error) {
console.log("error is:" + error);
});
};
}]);