qwc-services / qwc-services-core

QWC services core
MIT License
9 stars 8 forks source link

Fix JWT_ACCESS_COOKIE_PATH with tenant #11

Closed benoitblanc closed 9 months ago

benoitblanc commented 9 months ago

Hi,

This PR should fix #10

We need to set JWT_ACCESS_COOKIE_PATH for the current tenant before each request to know if token has expired and redirect to login page if it is the case.

Thanks for the review

@gwenandres

manisandro commented 9 months ago

Does it work to run this only conditionally on app.session_interface.is_multi()?

tpo commented 9 months ago

do we need to do something on existing installation when upgrading to a version that includes this fix (regenerate tokens or whatever)?

benoitblanc commented 9 months ago

Does it work to run this only conditionally on app.session_interface.is_multi()?

Done it in the last commit. I need to check if app.session_interface is a TenantSessionInterface before to check is_multi()

do we need to do something on existing installation when upgrading to a version that includes this fix (regenerate tokens or whatever)?

I don't think you need to do something. On local instance, I was redirected correctly to login page when JWT token has expired instead of having a redirect loop error.

manisandro commented 9 months ago

Thanks!

tpo commented 9 months ago

I don't think you need to do something. On local instance, I was redirected correctly to login page when JWT token has expired instead of having a redirect loop error.

Thanks a lot for the info @benoitblanc !