diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 8f996a4..2f2ca11 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -4,12 +4,18 @@
-
+
-
-
-
+
+
+
+
+
+
+
+
+
@@ -86,11 +92,11 @@
+
-
@@ -162,7 +168,6 @@
-
@@ -187,7 +192,8 @@
-
+
+
diff --git a/pkg/internal/services/i18n.go b/pkg/internal/services/i18n.go
index 0fd4be1..891e506 100644
--- a/pkg/internal/services/i18n.go
+++ b/pkg/internal/services/i18n.go
@@ -19,7 +19,7 @@ const FallbackLanguage = "en-US"
var LocaleBundle *i18n.Bundle
func LoadLocalization() error {
- LocaleBundle = i18n.NewBundle(language.English)
+ LocaleBundle = i18n.NewBundle(language.AmericanEnglish)
LocaleBundle.RegisterUnmarshalFunc("json", json.Unmarshal)
var count int
diff --git a/pkg/internal/services/ticket.go b/pkg/internal/services/ticket.go
index 18defd6..50e2338 100644
--- a/pkg/internal/services/ticket.go
+++ b/pkg/internal/services/ticket.go
@@ -128,10 +128,15 @@ func ActiveTicket(ticket models.AuthTicket) (models.AuthTicket, error) {
if err := database.C.Save(&ticket).Error; err != nil {
return ticket, err
} else {
+ var account models.Account
+ if err := database.C.Where("id = ?", ticket.AccountID).Select("Language").First(&account).Error; err != nil {
+ return ticket, nil
+ }
+
_ = NewNotification(models.Notification{
Topic: "passport.security.alert",
- Title: GetLocalizedString("subjectLoginAlert", ticket.Account.Language),
- Body: fmt.Sprintf(GetLocalizedString("shortBodyLoginAlert", ticket.Account.Language), ticket.IpAddress),
+ Title: GetLocalizedString("subjectLoginAlert", account.Language),
+ Body: fmt.Sprintf(GetLocalizedString("shortBodyLoginAlert", account.Language), ticket.IpAddress),
Metadata: datatypes.JSONMap{
"ip_address": ticket.IpAddress,
"created_at": ticket.CreatedAt,
diff --git a/templates/email/en-US/confirm-deletion.tmpl b/templates/en-US/confirm-deletion.tmpl
similarity index 100%
rename from templates/email/en-US/confirm-deletion.tmpl
rename to templates/en-US/confirm-deletion.tmpl
diff --git a/templates/email/en-US/email-otp.tmpl b/templates/en-US/email-otp.tmpl
similarity index 100%
rename from templates/email/en-US/email-otp.tmpl
rename to templates/en-US/email-otp.tmpl
diff --git a/templates/email/en-US/register-confirm.tmpl b/templates/en-US/register-confirm.tmpl
similarity index 100%
rename from templates/email/en-US/register-confirm.tmpl
rename to templates/en-US/register-confirm.tmpl
diff --git a/templates/email/en-US/reset-password.tmpl b/templates/en-US/reset-password.tmpl
similarity index 100%
rename from templates/email/en-US/reset-password.tmpl
rename to templates/en-US/reset-password.tmpl
diff --git a/templates/email/zh-CN/confirm-deletion.tmpl b/templates/zh-CN/confirm-deletion.tmpl
similarity index 100%
rename from templates/email/zh-CN/confirm-deletion.tmpl
rename to templates/zh-CN/confirm-deletion.tmpl
diff --git a/templates/email/zh-CN/email-otp.tmpl b/templates/zh-CN/email-otp.tmpl
similarity index 100%
rename from templates/email/zh-CN/email-otp.tmpl
rename to templates/zh-CN/email-otp.tmpl
diff --git a/templates/email/zh-CN/register-confirm.tmpl b/templates/zh-CN/register-confirm.tmpl
similarity index 100%
rename from templates/email/zh-CN/register-confirm.tmpl
rename to templates/zh-CN/register-confirm.tmpl
diff --git a/templates/email/zh-CN/reset-password.tmpl b/templates/zh-CN/reset-password.tmpl
similarity index 100%
rename from templates/email/zh-CN/reset-password.tmpl
rename to templates/zh-CN/reset-password.tmpl