Merge branch 'main' of ssh://git.ma-al.com:8822/goc_daniel/b2b into translate

This commit is contained in:
2026-04-07 08:03:23 +02:00
22 changed files with 333 additions and 93 deletions

View File

@@ -77,6 +77,15 @@ func (us *UserSession) HasPermission(permission perms.Permission) bool {
return false
}
type UserLocale struct {
// User is the Target user if present, otherwise same as Original.
// User ought to be used in applications
User *Customer
// Original user is the one associated with auth token
OriginalUser *Customer
// Importantly, lang_id used in application is stored as OriginalUser.LangID
}
// ToSession converts User to UserSession
func (u *Customer) ToSession() *UserSession {
@@ -106,6 +115,7 @@ func BuildPermissionSlice(user *Customer) []perms.Permission {
type LoginRequest struct {
Email string `json:"email" form:"email"`
Password string `json:"password" form:"password"`
LangID *uint `json:"lang_id" form:"lang_id"`
}
// RegisterRequest represents the initial registration form data