recovery fix
This commit is contained in:
parent
aeca330685
commit
52b9682f60
@ -60,7 +60,7 @@ func (p *PromoCodeController) Activate(c *fiber.Ctx) error {
|
||||
case errors.Is(err, repository.ErrPromoCodeExpired):
|
||||
hlogger.Emit(models.InfoPromocodeDeadlined{
|
||||
|
||||
CtxID: promocode.ID.String(),
|
||||
CtxID: req.Codeword,
|
||||
})
|
||||
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": err.Error()})
|
||||
case errors.Is(err, repository.ErrPromoCodeExhausted):
|
||||
|
@ -10,6 +10,7 @@ import (
|
||||
"go.uber.org/zap"
|
||||
"gitea.pena/PenaSide/common/log_mw"
|
||||
"time"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type Deps struct {
|
||||
@ -83,7 +84,7 @@ func (r *RecoveryController) HandleRecoveryRequest(c *fiber.Ctx) error {
|
||||
|
||||
signWithID := sign + id // подпись с id записи
|
||||
|
||||
err = r.service.RecoveryEmailTask(c.Context(), models.RecEmailDeps{UserID: user.ID.Hex(), Email: req.Email, SignWithID: signWithID, ID: id})
|
||||
err = r.service.RecoveryEmailTask(c.Context(), models.RecEmailDeps{UserID: user.ID.Hex(), Email: req.Email, SignWithID: strings.Replace(signUrl, "/changepwd","",1)+"/codeword/recover/"+signWithID, ID: id})
|
||||
if err != nil {
|
||||
r.logger.Error("Failed to send recovery email", zap.Error(err))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user