Skip to content

Commit

Permalink
[SDP-1031] Coinspect SDP-012 Enhance User Awareness for SMS One-Time …
Browse files Browse the repository at this point in the history
…Password (OTP) Usage (#138)

Add a disclaimer to the SMS message warning users about the risk of sharing their wallet registration OTP with a third party
  • Loading branch information
ziyliu authored Jan 5, 2024
1 parent 84349b2 commit 68032ad
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/serve/httphandler/receiver_send_otp_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ import (
"github.com/stellar/stellar-disbursement-platform-backend/internal/utils"
)

// OTPMessageDisclaimer contains disclaimer text that needs to be added as part of the OTP message to remind the
// receiver how sensitive the data is.
const OTPMessageDisclaimer = " If you did not request this code, please ignore. Do not share your code with anyone."

type ReceiverSendOTPHandler struct {
Models *data.Models
SMSMessengerClient message.MessengerClient
Expand Down Expand Up @@ -125,7 +129,7 @@ func (h ReceiverSendOTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request
OrganizationName: organization.Name,
}

otpMessageTemplate := organization.OTPMessageTemplate
otpMessageTemplate := organization.OTPMessageTemplate + OTPMessageDisclaimer
if !strings.Contains(organization.OTPMessageTemplate, "{{.OTP}}") {
// Adding the OTP code to the template
otpMessageTemplate = fmt.Sprintf(`{{.OTP}} %s`, strings.TrimSpace(otpMessageTemplate))
Expand Down

0 comments on commit 68032ad

Please sign in to comment.