feat: validate personal and enterprise auth tenants

This commit is contained in:
richjohnrambo
2026-09-21 21:24:25 +08:00
parent fc393cd685
commit 186cfa21c8
9 changed files with 689 additions and 53 deletions
+6
View File
@@ -1143,6 +1143,12 @@ func (s *Session) login(msg *ClientComMessage) {
return
}
if err := validateLoginTenant(s, msg); err != nil {
logs.Warn.Println("s.login: invalid login tenant", err, s.sid)
s.queueOut(decodeStoreError(types.ErrPolicy, msg.Id, msg.Timestamp, loginTenantErrorParams(err)))
return
}
handler := store.Store.GetLogicalAuthHandler(msg.Login.Scheme)
if handler == nil {
recordSessionLoginFailure(s, msg.Login.Scheme, msg.Login.Secret, nil, msg.Id, types.ErrUnsupported, msg.Timestamp)