From 2c901cf16242a44119b5ac64e147f5ea854d6b60 Mon Sep 17 00:00:00 2001 From: "A.Unger" Date: Wed, 22 Jul 2020 09:36:38 +0200 Subject: [PATCH] refactor --- pkg/service/v0/service.go | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/pkg/service/v0/service.go b/pkg/service/v0/service.go index 336537a65a..1fe5af3396 100644 --- a/pkg/service/v0/service.go +++ b/pkg/service/v0/service.go @@ -115,15 +115,9 @@ func getFailsafeIdentifier(c context.Context, identifier *proto.Identifier) *pro identifier = &proto.Identifier{} } if identifier.AccountUuid == "me" { - ownAccountUUID, ok := c.Value(middleware.UUIDKey).(string) - if ok { - if len(ownAccountUUID) > 0 { - identifier.AccountUuid = ownAccountUUID - } + if ownAccountUUID, ok := c.Value(middleware.UUIDKey).(string); ok { + identifier.AccountUuid = ownAccountUUID } - // might be valid for the request not having an AccountUuid in the identifier. - // but clear it, instead of passing on `me`. - identifier.AccountUuid = "" } identifier.AccountUuid = strings.ToLower(identifier.AccountUuid) return identifier