Better signing error, setup api test certs.

This commit is contained in:
Matthew Dillon 2015-01-05 14:51:31 -09:00
parent 3203c63237
commit 50c09481ec
2 changed files with 2 additions and 1 deletions

View file

@ -28,6 +28,7 @@ var (
func setup() { func setup() {
store = datastore.NewMockDatastore() store = datastore.NewMockDatastore()
SetupCerts("../keys/")
resp, _ := httpClient.PostForm(apiClient.BaseURL.String()+"authenticate/", resp, _ := httpClient.PostForm(apiClient.BaseURL.String()+"authenticate/",
url.Values{"username": {"test_user"}, "password": {"password"}}) url.Values{"username": {"test_user"}, "password": {"password"}})
defer resp.Body.Close() defer resp.Body.Close()

View file

@ -77,7 +77,7 @@ func serveAuthenticateUser(w http.ResponseWriter, r *http.Request) error {
tokenString, err := t.SignedString(signKey) tokenString, err := t.SignedString(signKey)
if err != nil { if err != nil {
w.WriteHeader(http.StatusInternalServerError) w.WriteHeader(http.StatusInternalServerError)
return errWhileSigningToken return err
} }
http.SetCookie(w, &http.Cookie{ http.SetCookie(w, &http.Cookie{