Remove sensitive information from LoggedUser endpoint

This commit is contained in:
Marcos Lilljedahl
2017-11-09 19:21:31 -03:00
parent 15a833fcf5
commit e91a1f3e6f
2 changed files with 1 additions and 17 deletions

View File

@@ -17,22 +17,6 @@ import (
"github.com/twinj/uuid"
)
func LoggedInUser(rw http.ResponseWriter, req *http.Request) {
cookie, err := ReadCookie(req)
if err != nil {
log.Println("Cannot read cookie")
rw.WriteHeader(http.StatusUnauthorized)
return
}
user, err := core.UserGet(cookie.Id)
if err != nil {
log.Printf("Couldn't get user with id %s. Got: %v\n", cookie.Id, err)
rw.WriteHeader(http.StatusUnauthorized)
return
}
json.NewEncoder(rw).Encode(user)
}
func ListProviders(rw http.ResponseWriter, req *http.Request) {
providers := []string{}
for name, _ := range config.Providers {