mirror of
https://github.com/h44z/wg-portal
synced 2025-06-26 18:16:21 +00:00
Run gofmt on domain validation code
This commit is contained in:
parent
7732a9232b
commit
daf07ddf25
@ -394,22 +394,21 @@ func (a *Authenticator) randString(nByte int) (string, error) {
|
||||
return base64.RawURLEncoding.EncodeToString(b), nil
|
||||
}
|
||||
|
||||
|
||||
func isDomainAllowed(email string, allowedDomains []string) bool {
|
||||
if len(allowedDomains) == 0 {
|
||||
return true
|
||||
}
|
||||
parts := strings.Split(email, "@")
|
||||
if len(parts) != 2 {
|
||||
return false
|
||||
}
|
||||
domain := strings.ToLower(parts[1])
|
||||
for _, allowed := range allowedDomains {
|
||||
if domain == strings.ToLower(allowed) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
parts := strings.Split(email, "@")
|
||||
if len(parts) != 2 {
|
||||
return false
|
||||
}
|
||||
domain := strings.ToLower(parts[1])
|
||||
for _, allowed := range allowedDomains {
|
||||
if domain == strings.ToLower(allowed) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// OauthLoginStep2 finishes the oauth authentication flow by exchanging the code for an access token and
|
||||
|
Loading…
Reference in New Issue
Block a user