url routing - SvelteKit Duplicate Routes in Layout Groups - Stack Overflow

Is it possible to have the same route be on different layout groups in SvelteKit. I want to have two di

Is it possible to have the same route be on different layout groups in SvelteKit. I want to have two different layout groups "/(private)/(app)" and "/(public)/(landing)" that define the routes for my authenticated and not authenticated pages. Normally I can do this in NGINX by making an auth subrequest. But in SvelteKit I get the following error:

The "/(private)/(app)" and "/(public)/(landing)" routes conflict with each other

Can we define this in the hooks.server.ts file or maybe the root layout.server.ts?

Is it possible to have the same route be on different layout groups in SvelteKit. I want to have two different layout groups "/(private)/(app)" and "/(public)/(landing)" that define the routes for my authenticated and not authenticated pages. Normally I can do this in NGINX by making an auth subrequest. But in SvelteKit I get the following error:

The "/(private)/(app)" and "/(public)/(landing)" routes conflict with each other

Can we define this in the hooks.server.ts file or maybe the root layout.server.ts?

Share Improve this question asked yesterday Rey Christian EustaquioRey Christian Eustaquio 212 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

I do not think this is currently possible.

Recently an issue has been opened about a similar problem. As noted there, this would be a use case for the reroute hook, but it currently has a cacheability requirement (which will not work if the deciding factor is the authentication status of the user).

With reroute, you can keep the URL as is but return a specific route, so you could turn the groups into regular path segments which will not be visible but help disambiguate the routing.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1743778791a4505722.html

相关推荐

  • url routing - SvelteKit Duplicate Routes in Layout Groups - Stack Overflow

    Is it possible to have the same route be on different layout groups in SvelteKit. I want to have two di

    7天前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信