You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@siredwin The problem is simple. Authboss functions require the http.ResponseWriter's underlying type to be an authboss.ClientStateReadWriter OR an authboss.UnderlyingResponseWriter. If it is not one of those two things it will break.
Echo is one of few frameworks that replace the http.ResponseWriter from the http.Server with its own thing. That means that the LoadClientStateMiddleware has to be positioned AFTER Echo's replacement of the response writer, so that middlewares and handlers receive the Authboss RW, and not the Echo RW.
Abandoning "Authboss or Echo for Go-chi" is an excellent idea. Chi does not replace the response writer and so is an excellent companion to Authboss. We use Authboss + Chi for our projects.
I figured that much.
I think re-writing DataInjector into an echo middleware will be enough for now. It is working so far when I do it manually with data := LayoutData(w, r)
That also answers my question of if you chose chi example for that reason.
I am using the
echo
Framework.I am at a point where I have to abandon
AuthBoss
orEcho
forGo-chi
.I have found the cause of the problem though, it is the
dataInjector
. It somehow hijacks the context.The
LoadClientStateMiddleware
is just ok.I am going to try to modify it and see if it works.
If you can think of anything else wrong with it, let me know.
The text was updated successfully, but these errors were encountered: