From a52d19e9e78d08643ffd4aee0483515d8bae2939 Mon Sep 17 00:00:00 2001 From: Niall Sheridan Date: Thu, 2 Jun 2016 20:43:04 +0100 Subject: Validate tokens correctly This switch statement doesn't do what I thought it does --- server/auth/google/google.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'server/auth/google') 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 -- cgit v1.2.3