mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-20 15:29:28 +01:00
feat(be): http only for cookies
This commit is contained in:
parent
35e886b436
commit
834f75bac0
@ -16,13 +16,13 @@ import (
|
|||||||
"text/template"
|
"text/template"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/coreos/go-oidc/v3/oidc"
|
||||||
|
"github.com/go-ldap/ldap/v3"
|
||||||
|
"github.com/gorilla/mux"
|
||||||
"github.com/semaphoreui/semaphore/api/helpers"
|
"github.com/semaphoreui/semaphore/api/helpers"
|
||||||
"github.com/semaphoreui/semaphore/db"
|
"github.com/semaphoreui/semaphore/db"
|
||||||
"github.com/semaphoreui/semaphore/pkg/random"
|
"github.com/semaphoreui/semaphore/pkg/random"
|
||||||
"github.com/semaphoreui/semaphore/util"
|
"github.com/semaphoreui/semaphore/util"
|
||||||
"github.com/coreos/go-oidc/v3/oidc"
|
|
||||||
"github.com/go-ldap/ldap/v3"
|
|
||||||
"github.com/gorilla/mux"
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
"golang.org/x/oauth2"
|
"golang.org/x/oauth2"
|
||||||
@ -174,6 +174,7 @@ func createSession(w http.ResponseWriter, r *http.Request, user db.User) {
|
|||||||
Name: "semaphore",
|
Name: "semaphore",
|
||||||
Value: encoded,
|
Value: encoded,
|
||||||
Path: "/",
|
Path: "/",
|
||||||
|
HttpOnly: true,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,6 +322,7 @@ func logout(w http.ResponseWriter, r *http.Request) {
|
|||||||
Value: "",
|
Value: "",
|
||||||
Expires: time.Now().Add(24 * 7 * time.Hour * -1),
|
Expires: time.Now().Add(24 * 7 * time.Hour * -1),
|
||||||
Path: "/",
|
Path: "/",
|
||||||
|
HttpOnly: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
w.WriteHeader(http.StatusNoContent)
|
w.WriteHeader(http.StatusNoContent)
|
||||||
|
Loading…
Reference in New Issue
Block a user