mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-09 18:44:16 +00:00
improve public routes parser
This commit is contained in:
parent
ccdc97191a
commit
300577706a
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user