check full email in AllowAuth
This commit is contained in:
@@ -3,6 +3,7 @@ package bot
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"gitlab.com/etke.cc/go/mxidwc"
|
"gitlab.com/etke.cc/go/mxidwc"
|
||||||
"maunium.net/go/mautrix/id"
|
"maunium.net/go/mautrix/id"
|
||||||
|
|||||||
@@ -36,8 +36,7 @@ func (m *msa) Login(state *smtp.ConnectionState, username, password string) (smt
|
|||||||
return nil, errors.New("please, provide an email address")
|
return nil, errors.New("please, provide an email address")
|
||||||
}
|
}
|
||||||
|
|
||||||
mailbox := utils.Mailbox(username)
|
if !m.bot.AllowAuth(username, password) {
|
||||||
if !m.bot.AllowAuth(mailbox, password) {
|
|
||||||
return nil, errors.New("email or password is invalid")
|
return nil, errors.New("email or password is invalid")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user