silvermobi/servers/grpcapi/server/update_password.go

24 lines
617 B
Go

package grpcserver
import (
"context"
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
"github.com/rs/zerolog/log"
)
func (s SilvermobiGRPCService) UpdatePassword(ctx context.Context, req *grpcproto.UpdatePasswordRequest) (res *grpcproto.UpdatePasswordResponse, err error) {
log.Info().
Str("username", req.Email).
Msg("Update Password")
result := s.Handler.UpdatePassword(ctx, req.Email, req.Password)
if result == true {
return &grpcproto.UpdatePasswordResponse{
Response: true,
}, nil
} else {
return &grpcproto.UpdatePasswordResponse{
Response: false,
}, nil
}
}