From 2da179aee485ae7838820370c765215f6fe77f7b Mon Sep 17 00:00:00 2001 From: derek mcquay Date: Thu, 25 Aug 2016 13:08:19 -0700 Subject: [PATCH] behavior for relogging in corrected --- server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server.go b/server.go index 9fc9440..28c8916 100644 --- a/server.go +++ b/server.go @@ -198,6 +198,11 @@ func (s *Server) listUsers(w http.ResponseWriter, r *http.Request) { } func (s *Server) login(w http.ResponseWriter, r *http.Request) { + session, _ := store.Get(r, "creds") + if loggedIn := session.Values["authenticated"]; loggedIn == true { + http.Redirect(w, r, "/static/", http.StatusTemporaryRedirect) + return + } oauthConf.ClientID = s.ClientID oauthConf.ClientSecret = s.ClientSecret url := oauthConf.AuthCodeURL(oauthStateString, oauth2.AccessTypeOnline)