oblique-bit / oblique

An Angular front-end framework Tailored for your swiss branded business web application, Oblique provides a standardized corporate design look and feel as well as a collection of ready-to-use Angular components. Oblique, through its fully customizable master layout, takes care of the application's structure, letting you focus on the content.
https://oblique.bit.admin.ch
MIT License
55 stars 13 forks source link

Interaction of `ObHttpApiInterceptor` and `ObEportalCsrfInterceptor` #118

Open nbenn opened 11 months ago

nbenn commented 11 months ago

Migrating an Oblique app from the ePortal-provided "header widget" to the oblique-native "service navigation" I ran into CORS issues (with calls to the PAMS API). It appears that ObHttpApiInterceptor (with default configuration) and ObEportalCsrfInterceptor are currently not compatible. A quick note on this in the docs or a default config for ObHttpApiInterceptor that does not intercept PAMS API calls might be helpful.

nina-egger commented 10 months ago

Hello,

Thank you for your report. I will forward this issue to the architects. The internal issue number is OUI-2550

Kind regards

ice-blaze commented 10 months ago

@nbenn have you tried to set this config ?

constructor(
  private readonly interceptorConfig: ObHttpApiInterceptorConfig,
) {
  this.interceptorConfig.api.url = 'http://my-app.com';
}

I'm still checking if I can add a whitelist for pams endpoints but at least your have a workaround.

nbenn commented 10 months ago

@ice-blaze Thanks for the feedback. Yes, this is what I have been doing. It took me a bit to figure out that the spinner-interceptor was causing my issues. As soon as I had that sorted, the problem was easy to address. My comment was more to save others from the troubles I had (either via some comment in the docs or a smarter default behavior).