vardius / go-api-boilerplate

Go Server/API boilerplate using best practices DDD CQRS ES gRPC
https://go-api-boilerplate.local
MIT License
929 stars 135 forks source link

Hotfix/add missing user domain transition #45

Closed mar1n3r0 closed 4 years ago

vardius commented 4 years ago

I do not think there is any issue in the domain implementation. I believe this error was introduced with this change:

+   // Protected User routes
+   router.POST("/v1/dispatch/"+user.ChangeUserEmailAddress, commandDispatchHandler)
    router.USE(http.MethodPost, "/v1/dispatch/"+user.ChangeUserEmailAddress, firewall.GrantAccessFor("USER"))

+   // Public User routes
    router.POST("/v1/dispatch/{command}", commandDispatchHandler)

The declaration for "/v1/dispatch/"+user.ChangeUserEmailAddress route should not be necessary and if middleware is not being called, then it is a router problem. I am pretty sure that this logic was working (flow described in the readme file) so either this change, or latest version of gorouter introduced this issue.

Edit: https://github.com/vardius/gorouter/issues/14

vardius commented 4 years ago

https://github.com/vardius/go-api-boilerplate/issues/39#issuecomment-570142681

mar1n3r0 commented 4 years ago

I can try the whole flow again after the merge and we will take it from there.