This commit is contained in:
A.Unger
2020-07-22 09:36:38 +02:00
parent ca9e59c8b4
commit 2c901cf162
+2 -8
View File
@@ -115,15 +115,9 @@ func getFailsafeIdentifier(c context.Context, identifier *proto.Identifier) *pro
identifier = &proto.Identifier{} identifier = &proto.Identifier{}
} }
if identifier.AccountUuid == "me" { if identifier.AccountUuid == "me" {
ownAccountUUID, ok := c.Value(middleware.UUIDKey).(string) if ownAccountUUID, ok := c.Value(middleware.UUIDKey).(string); ok {
if ok { identifier.AccountUuid = ownAccountUUID
if len(ownAccountUUID) > 0 {
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) identifier.AccountUuid = strings.ToLower(identifier.AccountUuid)
return identifier return identifier