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