converted email addresses to lowercase for compatibility with VLESS and Trojan protocol with inbounduser api

This commit is contained in:
fL1pSt3r 2025-06-15 22:07:38 +03:00
parent fbae89d017
commit 23077362b1
2 changed files with 2 additions and 0 deletions

View file

@ -53,6 +53,7 @@ func (v *Validator) Get(hash string) *protocol.MemoryUser {
// Get a trojan user with hashed key, nil if user doesn't exist. // Get a trojan user with hashed key, nil if user doesn't exist.
func (v *Validator) GetByEmail(email string) *protocol.MemoryUser { func (v *Validator) GetByEmail(email string) *protocol.MemoryUser {
email = strings.ToLower(email)
u, _ := v.email.Load(email) u, _ := v.email.Load(email)
if u != nil { if u != nil {
return u.(*protocol.MemoryUser) return u.(*protocol.MemoryUser)

View file

@ -63,6 +63,7 @@ func (v *MemoryValidator) Get(id uuid.UUID) *protocol.MemoryUser {
// Get a VLESS user with email, nil if user doesn't exist. // Get a VLESS user with email, nil if user doesn't exist.
func (v *MemoryValidator) GetByEmail(email string) *protocol.MemoryUser { func (v *MemoryValidator) GetByEmail(email string) *protocol.MemoryUser {
email = strings.ToLower(email)
u, _ := v.email.Load(email) u, _ := v.email.Load(email)
if u != nil { if u != nil {
return u.(*protocol.MemoryUser) return u.(*protocol.MemoryUser)