I recently started working with Angular and I feel completely lost.
My initial task involves making a simple Rest-GET request, but the destination is located behind an external login page. This results in my request being redirected to the external page and causing my application to fail.
What I am trying to achieve is to open the redirected page, log in successfully, and then be redirected back to the originally requested page (assuming this should be handled by the external page).
Although my code isn't very advanced yet, here it is:
var app = angular.module('webUI', [])
app.controller('Rest', function($scope, $http) {
$http.get('https://test/rest/monitoring')
.then(function successCallback(response) {
$scope.rest = response.data;
}, function errorCallback(response){
});
});
Is there a straightforward Angular function that I may be overlooking, which could help me achieve what I'm aiming for?
Edit: Here is the error message that appears in my browser console (Chrome->F12):
The redirect from '' to '' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.