Fix go-micro auth wrapper init

This commit is contained in:
Ben Toogood
2020-04-03 12:27:01 +01:00
parent ebb1a42d48
commit dea2d7ab9f
3 changed files with 4 additions and 4 deletions

View File

@@ -34,8 +34,9 @@ func newService(opts ...Option) Service {
// service name
serviceName := options.Server.Options().Name
// TODO: better accessors
authFn := func() auth.Auth { return options.Auth }
// authFn returns the auth, we pass as a function since auth
// has not yet been set at this point.
authFn := func() auth.Auth { return options.Server.Options().Auth }
// wrap client to inject From-Service header on any calls
options.Client = wrapper.FromService(serviceName, options.Client, authFn)