Auth best practice: middleware or root beforeload?
I am just curious what people prefer and why they think it is better than the other.
1 Reply
eastern-cyan•2w ago
Hey @Nicolay ,
I have seen both
-
beforeLoad
on file-route for redirecting if the user isn't logged like this
- middleware
on server-functions for accessing protected user data