2 Replies
This is my middleware.ts file, currently it checks that each user that accesses the dashboard is authenticated.
What I want to add onto this is:
- User cant access a guild that they are not in (I have a function which fetches the guilds of a user)
- User cant access the admin panel ('/dashboard/${guild.id}/admin') if they are not the owner of the guild
- User cant access a guild url that doesnt have the discord application within the guild ( I have a function which responses with a boolean by inputting a guild.id)
I just have cant piece together how I can do this within the middleware.ts file
Hey, have you solved it?