From 76682ab27f3d1004f08a21d8ec42d9a8d52f6422 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 15 Feb 2025 18:33:13 +0800 Subject: [PATCH] :bug: Fix wrong type of notify OTP --- pkg/internal/services/factors.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkg/internal/services/factors.go b/pkg/internal/services/factors.go index 2035077..dc373a6 100644 --- a/pkg/internal/services/factors.go +++ b/pkg/internal/services/factors.go @@ -2,10 +2,11 @@ package services import ( "fmt" - "git.solsynth.dev/hypernet/nexus/pkg/nex/localize" "strings" "time" + "git.solsynth.dev/hypernet/nexus/pkg/nex/localize" + "git.solsynth.dev/hypernet/passport/pkg/authkit/models" "git.solsynth.dev/hypernet/passport/pkg/internal/database" "git.solsynth.dev/hypernet/passport/pkg/internal/gap" @@ -75,14 +76,14 @@ func GetFactorCode(factor models.AuthFactor, ip string) (bool, error) { log.Info().Uint("factor", factor.ID).Str("secret", secret).Msg("Published one-time-password to JetStream...") } - err = PushNotification(models.Notification{ + err = NewNotification(models.Notification{ Topic: "passport.security.otp", Title: localize.L.GetLocalizedString("subjectLoginOneTimePassword", user.Language), Body: fmt.Sprintf(localize.L.GetLocalizedString("shortBodyLoginOneTimePassword", user.Language), secret), Account: user, AccountID: user.ID, Metadata: map[string]any{"secret": secret}, - }, true) + }) if err != nil { log.Warn().Err(err).Uint("factor", factor.ID).Msg("Failed to delivery one-time-password via notify...") return true, nil