Authorizing (getting user role inside the middleware to do the check)
Unanswered
Philippine Crocodile posted this in #help-forum
Philippine CrocodileOP
Hi, I’m right now developing an app where I kind of want to add user role check inside the middleware instead of in layouts or in protected route pages or whatever!
I’ve tried multiple solutions but when I try to do that inside middleware the browser gives me too many redirects error.
It would be helpful if you could give me some tips to manage this.
Thanks in advance!
I’ve tried multiple solutions but when I try to do that inside middleware the browser gives me too many redirects error.
It would be helpful if you could give me some tips to manage this.
Thanks in advance!
3 Replies
European pilchard
I have been getting this too and I have been asking for about 3 weeks with no response. I know there is also a GitHub issue that I believe is still open, and the last comment was made about 1-2 weeks ago.
European pilchard
I think the issue is related to the middleware triggering multiple times on the same route somehow despite having a matcher
@Philippine Crocodile Would be helpful if you could post some code related to the issue you are having