joas8211 / payload-tenancy

Multi-tenancy plugin for Payload CMS
MIT License
150 stars 11 forks source link

Admin panel won't load for tenants that have slug with special characters #12

Open joas8211 opened 1 year ago

joas8211 commented 1 year ago

Admin panel front-end won't render for tenants that have slug with special characters. This happens when percent-encoding is used for the path.

joas8211 commented 1 year ago

I think it might be because React Router won't match the path correctly. This issue might be related: https://github.com/remix-run/react-router/issues/10213

joas8211 commented 1 year ago

I think it might be because React Router won't match the path correctly. This issue might be related: remix-run/react-router#10213

Actually, Payload CMS uses version 5 of React Router DOM, so the issue might be already fixed in version 6 of the library.

joas8211 commented 1 year ago

To fix this, it should be disallow to use a space character in tenant slug.

joas8211 commented 1 year ago

This still seems to be an issue. Other special characters are also causing problems. What I can see routing used in backend and frontend work differently. I'm considering to limit slugs to ASCII only.