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
|
return base64.RawURLEncoding.EncodeToString(b), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func isDomainAllowed(email string, allowedDomains []string) bool {
|
func isDomainAllowed(email string, allowedDomains []string) bool {
|
||||||
if len(allowedDomains) == 0 {
|
if len(allowedDomains) == 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
parts := strings.Split(email, "@")
|
parts := strings.Split(email, "@")
|
||||||
if len(parts) != 2 {
|
if len(parts) != 2 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
domain := strings.ToLower(parts[1])
|
domain := strings.ToLower(parts[1])
|
||||||
for _, allowed := range allowedDomains {
|
for _, allowed := range allowedDomains {
|
||||||
if domain == strings.ToLower(allowed) {
|
if domain == strings.ToLower(allowed) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// OauthLoginStep2 finishes the oauth authentication flow by exchanging the code for an access token and
|
// OauthLoginStep2 finishes the oauth authentication flow by exchanging the code for an access token and
|
||||||
|
Loading…
Reference in New Issue
Block a user