Skip to content

Commit

Permalink
Merge branch 'main' into laverya/improve-startup-logging
Browse files Browse the repository at this point in the history
  • Loading branch information
laverya authored Nov 21, 2024
2 parents 753e65a + 707d5bc commit cebf487
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/image-deps-updater.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ jobs:
- name: Slack Notification
if: ${{ steps.cpr.outputs.pull-request-number }}
uses: slackapi/slack-github-action@v1.27.0
uses: slackapi/slack-github-action@v2.0.0
with:
payload: |
{
Expand Down
1 change: 1 addition & 0 deletions pkg/handlers/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func RequireValidSessionQuietMiddleware(kotsStore store.Store) mux.MiddlewareFun
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
sess, err := requireValidSession(kotsStore, w, r)
if err != nil {
logger.Errorf("failed validating session: %s", err)
return
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func requireValidSession(kotsStore store.Store, w http.ResponseWriter, r *http.R
passwordUpdatedAt, err := kotsStore.GetPasswordUpdatedAt()
if err != nil {
response := types.ErrorResponse{Error: util.StrPointer("failed to validate session with current password")}
JSON(w, http.StatusUnauthorized, response)
JSON(w, http.StatusInternalServerError, response)
return nil, err
}
if passwordUpdatedAt != nil && passwordUpdatedAt.After(sess.IssuedAt) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/session_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func Test_requireValidSession_FailedToFetchPasswordUpdated_AfterSessionIssuedErr
req.Error(err)
req.Equal("failed to fetch password updatedAt", err.Error())
req.Equal(want, got)
req.Equal(401, w.Code)
req.Equal(500, w.Code)
}

func Test_requireValidSession_PasswordUpdated_AfterSessionIssuedErr(t *testing.T) {
Expand Down

0 comments on commit cebf487

Please sign in to comment.