sulu / SuluHeadlessBundle

Bundle that provides controllers and services for using Sulu as headless content management system
MIT License
47 stars 25 forks source link

Example Router does not follow redirects #86

Open alexander-schranz opened 3 years ago

alexander-schranz commented 3 years ago

Currently when we are requesting any url which will be redirected the router.js will not redirect the frontend:

This is the case because fetch is by default following here the redirect and so will return the target data: https://github.com/sulu/SuluHeadlessBundle/blob/fc701ca9c79ad490c35501db00097bab5132bf13/Resources/js-website/src/services/router.js#L47

The router should do a fetch request without following the redirect and if the response does have a redirect in it it should follow that manually by calling router.goTo(newUrl).

Examples when this is happening: