--
This commit is contained in:
parent
73a9cd5544
commit
2f2423106e
@ -6,6 +6,7 @@ services:
|
||||
APP_NAME: 'codeword'
|
||||
CLIENT_HTTP_URL: '0.0.0.0:3000'
|
||||
ADMIN_HTTP_URL: '0.0.0.0:3001'
|
||||
GRPC_URL: '0.0.0.0:9000'
|
||||
MONGO_URL: mongodb://auth-service-user-prod:LFYFpTvqtxSzXDJV@10.8.0.226:27017/?authSource=auth
|
||||
MONGO_DB_NAME: auth
|
||||
ENCRYPT_PUBLIC_KEY: "-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEAEbnIvjIMle4rqVol6K2XUqOxHy1KJoNoZdKJrRUPKL4=\n-----END PUBLIC KEY-----"
|
||||
|
@ -68,7 +68,7 @@ func (r *RecoveryController) HandleRecoveryRequest(c *fiber.Ctx) error {
|
||||
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{"error": "Internal Server Error"})
|
||||
}
|
||||
|
||||
signUrl := referralURL +"/codeword/v1.0.0/recover"+ req.RedirectionURL
|
||||
signUrl := referralURL +"/codeword/v1.0.0/recover"
|
||||
sign := base64.URLEncoding.EncodeToString(key)
|
||||
|
||||
id, err := r.service.StoreRecoveryRecord(c.Context(), models.StoreRecDeps{
|
||||
@ -84,7 +84,12 @@ 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: strings.Replace(signUrl, "/changepwd","",1) + "/"+signWithID, ID: id})
|
||||
err = r.service.RecoveryEmailTask(c.Context(), models.RecEmailDeps{
|
||||
UserID: user.ID.Hex(),
|
||||
Email: req.Email,
|
||||
SignWithID: strings.Replace(signUrl, "/changepwd","",1) + "/"+signWithID,
|
||||
ID: id,
|
||||
})
|
||||
if err != nil {
|
||||
r.logger.Error("Failed to send recovery email", zap.Error(err))
|
||||
|
||||
@ -148,5 +153,5 @@ func (r *RecoveryController) HandleRecoveryLink(c *fiber.Ctx) error {
|
||||
CtxUserID: record.UserID,
|
||||
})
|
||||
|
||||
return c.Redirect("https://" + strings.Replace(record.SignUrl,"/codeword/v1.0.0/recover","",1) + "?auth=" + tokens["accessToken"])
|
||||
return c.Redirect("https://" + strings.Replace(record.SignUrl,"/codeword/v1.0.0/recover","/changepwd",1) + "?auth=" + tokens["accessToken"])
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user