From a52d19e9e78d08643ffd4aee0483515d8bae2939 Mon Sep 17 00:00:00 2001
From: Niall Sheridan <nsheridan@gmail.com>
Date: Thu, 2 Jun 2016 20:43:04 +0100
Subject: [PATCH] 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(-)

diff --git a/server/auth/google/google.go b/server/auth/google/google.go
index 0328d428..7c9b9307 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
-- 
GitLab