behavior for relogging in corrected

This commit is contained in:
Derek McQuay 2016-08-25 13:08:19 -07:00
parent 6aebd3476c
commit 2da179aee4
1 changed files with 5 additions and 0 deletions

View File

@ -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)