From 5360ed1baa06790a010318ea554ac55544d888e1 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Fri, 31 Jan 2020 00:28:05 +0100 Subject: [PATCH] Cover Identifiable scenario for User.FindByAny() --- system/service/user.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/system/service/user.go b/system/service/user.go index 089bbe9d6..a5b56317e 100644 --- a/system/service/user.go +++ b/system/service/user.go @@ -180,6 +180,8 @@ func (svc user) FindByAny(identifier interface{}) (u *types.User, err error) { if ID, ok := identifier.(uint64); ok { u, err = svc.FindByID(ID) + } else if identity, ok := identifier.(internalAuth.Identifiable); ok { + u, err = svc.FindByID(identity.Identity()) } else if strIdentifier, ok := identifier.(string); ok { if ID, _ := strconv.ParseUint(strIdentifier, 10, 64); ID > 0 { u, err = svc.FindByID(ID)