feat(07-02): serve login, logout, fetch, and refresh
Wire the user API session loop to the JWT blacklist and a pre-password throttle gate so a logged-out token cannot be fetched again. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,17 +7,17 @@ import (
|
||||
"git.golem15.com/golem15/summercms/towel"
|
||||
)
|
||||
|
||||
// mailTemplate appends -en for English and leaves every other locale,
|
||||
// MailTemplate appends -en for English and leaves every other locale,
|
||||
// including empty and pl, on the unsuffixed Polish template name.
|
||||
func mailTemplate(base, locale string) string {
|
||||
func MailTemplate(base, locale string) string {
|
||||
if locale == "en" {
|
||||
return base + "-en"
|
||||
}
|
||||
return base
|
||||
}
|
||||
|
||||
// resolveMailLocale prefers the user's saved locale, then the request locale.
|
||||
func resolveMailLocale(ctx context.Context, user *models.User) string {
|
||||
// ResolveMailLocale prefers the user's saved locale, then the request locale.
|
||||
func ResolveMailLocale(ctx context.Context, user *models.User) string {
|
||||
if user != nil && user.PreferredLocale != nil && *user.PreferredLocale != "" {
|
||||
return *user.PreferredLocale
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user