Skip to content

Commit

Permalink
Merge branch 'feature-oidc' of https://github.com/canonical/jimm into…
Browse files Browse the repository at this point in the history
… css-6646/sessions
  • Loading branch information
ale8k committed Mar 6, 2024
2 parents ad3861d + 122abfb commit 35e11ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
8 changes: 4 additions & 4 deletions internal/jimmhttp/auth_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ func (oah *OAuthHandler) Callback(w http.ResponseWriter, r *http.Request) {
writeError(ctx, w, http.StatusBadRequest, err, "failed to get session")
}

session.IsNew = true // Sets cookie to a fresh new cookie
session.Options.MaxAge = 86400 // 24 Hours expiry
session.Options.Secure = false // Ensures only sent with HTTPS
session.Options.HttpOnly = false // Allow Javascript to read it
session.IsNew = true // Sets cookie to a fresh new cookie
session.Options.MaxAge = oah.cookieExpiry // 24 Hours expiry
session.Options.Secure = oah.secureCookies // Ensures only sent with HTTPS
session.Options.HttpOnly = false // Allow Javascript to read it

session.Values["jimm-session"] = email
if err = session.Save(r, w); err != nil {
Expand Down
1 change: 0 additions & 1 deletion internal/jimmhttp/auth_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ func setupTestServer(c *qt.C, dashboardURL string, db *db.Database, sessionStore

// Remember redirect url to check it matches after test server starts
redirectURL := "http://127.0.0.1:" + port + "/callback"

authSvc, err := auth.NewAuthenticationService(context.Background(), auth.AuthenticationServiceParams{
IssuerURL: "http://localhost:8082/realms/jimm",
ClientID: "jimm-device",
Expand Down

0 comments on commit 35e11ad

Please sign in to comment.