aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2016-06-02 20:43:04 +0100
committerNiall Sheridan <nsheridan@gmail.com>2016-06-02 20:43:04 +0100
commita52d19e9e78d08643ffd4aee0483515d8bae2939 (patch)
tree3e8140bf58a7732552594dd1174fc0a7431ceb1d
parentdc9d941ce60978594665122e028cb5afa6414d14 (diff)
Validate tokens correctly
This switch statement doesn't do what I thought it does
-rw-r--r--server/auth/google/google.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/server/auth/google/google.go b/server/auth/google/google.go
index 0328d42..7c9b930 100644
--- a/server/auth/google/google.go
+++ b/server/auth/google/google.go
@@ -73,9 +73,7 @@ func (c *Config) Valid(token *oauth2.Token) bool {
if err != nil {
return false
}
- switch {
- case ti.Audience != c.config.ClientID:
- case ui.Hd != c.domain:
+ if ti.Audience != c.config.ClientID || ui.Hd != c.domain {
return false
}
return true