Better signing error, setup api test certs.
This commit is contained in:
parent
3203c63237
commit
50c09481ec
2 changed files with 2 additions and 1 deletions
|
@ -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()
|
||||||
|
|
|
@ -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{
|
||||||
|
|
Reference in a new issue