From bb65b11566a105f6fe0e591ef7ff1aae0a31a4ae Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 21 Feb 2024 23:07:36 +0800 Subject: [PATCH] :bug: Fix grpc userinfo api get avatar id not url --- pkg/grpc/server.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/grpc/server.go b/pkg/grpc/server.go index 3f2c1fa..b172c8b 100644 --- a/pkg/grpc/server.go +++ b/pkg/grpc/server.go @@ -5,6 +5,7 @@ import ( "code.smartsheep.studio/hydrogen/identity/pkg/models" "code.smartsheep.studio/hydrogen/identity/pkg/services" "context" + "fmt" "github.com/samber/lo" "github.com/spf13/viper" "google.golang.org/grpc" @@ -31,8 +32,8 @@ func (v *Server) Authenticate(_ context.Context, in *proto.AuthRequest) (*proto. Userinfo: &proto.Userinfo{ Name: user.Name, Nick: user.Nick, - Avatar: user.Avatar, Email: user.GetPrimaryEmail().Content, + Avatar: fmt.Sprintf("https://%s/api/avatar/%s", viper.GetString("domain"), user.Avatar), Description: nil, }, }, nil