improve public routes parser

This commit is contained in:
srgooglo 2022-10-15 17:04:52 +02:00
parent ccdc97191a
commit 300577706a

View File

@ -133,8 +133,9 @@ export default class Layout extends React.PureComponent {
if (!this.props.user && currentRoute !== config.app?.authPath && currentRoute !== "/") {
const isPublicRoute = publicRoutes.some((route) => {
const regex = new RegExp(route.replace("*", ".*"))
return regex.test(currentRoute)
const routePath = route.replace(/\*/g, ".*").replace(/!/g, "^")
return new RegExp(routePath).test(currentRoute)
})
if (!isPublicRoute) {