Laravel 5.3 API request from ionic return login page
Hi guys ! I'm developing a mobile app with ionic 2 and i also built my API using laravel 5.3 with passport for auth. If any of you have already worked with ionic, when i do "ionic serve" in the terminal and try at the same time to call an endpoint of my API like http://my.server/api/post to retrieve all posts passing the token i received after login, it returns HTML content to me like it was redirecting me to the login page of Laravel. Nonetheless i don't have this issue using postman. But keep in mind that when i hit the http://my.server/oauth/token everything works like a charm. What might be the cause of this ?
But one thing to note in the screenshot is that before sending the request to the endpoint i console.log the the token to make sure it's being sent in the header