forked from forgejo/forgejo
Move user related model into models/user (#17781)
* Move user related model into models/user * Fix lint for windows * Fix windows lint * Fix windows lint * Move some tests in models * Merge
This commit is contained in:
parent
4e7ca946da
commit
a666829a37
345 changed files with 4230 additions and 3813 deletions
|
@ -6,13 +6,12 @@ package smtp
|
|||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/smtp"
|
||||
"os"
|
||||
"strconv"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
)
|
||||
|
||||
// _________ __________________________
|
||||
|
@ -52,6 +51,11 @@ const (
|
|||
// Authenticators contains available SMTP authentication type names.
|
||||
var Authenticators = []string{PlainAuthentication, LoginAuthentication, CRAMMD5Authentication}
|
||||
|
||||
var (
|
||||
// ErrUnsupportedLoginType login source is unknown error
|
||||
ErrUnsupportedLoginType = errors.New("Login source is unknown")
|
||||
)
|
||||
|
||||
// Authenticate performs an SMTP authentication.
|
||||
func Authenticate(a smtp.Auth, source *Source) error {
|
||||
tlsConfig := &tls.Config{
|
||||
|
@ -101,5 +105,5 @@ func Authenticate(a smtp.Auth, source *Source) error {
|
|||
return client.Auth(a)
|
||||
}
|
||||
|
||||
return models.ErrUnsupportedLoginType
|
||||
return ErrUnsupportedLoginType
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue