Tuesday 6 June 2017

has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present

We are using google authentication to authenticate the user.First time when user will try to access our web app URL, node server redirecting to /auth/google for sign-in as we are using 'google passport strategy'.

In case of fresh login it works fine but after session expiration its throwing CORS policy issue when its redirecting again to '/auth/google/'.

var isLoggedIn = function (req, res, next) {
if (req.isAuthenticated()) {
    return next(); //Go to the requested route
}

res.redirect('/auth/google'); };

enter image description here Please suggest.



via skumar

No comments:

Post a Comment