mirror of
https://github.com/pomerium/pomerium.git
synced 2025-08-03 08:50:42 +02:00
session: remove unused session state properties (#3022)
* fix error page * share dashboard code * sessions: remove unused session state properties * remove programmatic * remove version
This commit is contained in:
parent
0898dd4f34
commit
46c4d5fa7e
14 changed files with 59 additions and 126 deletions
|
@ -10,7 +10,6 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/go-jose/go-jose/v3/jwt"
|
||||
"github.com/google/uuid"
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/pomerium/csrf"
|
||||
|
@ -230,10 +229,6 @@ func (a *Authenticate) SignIn(w http.ResponseWriter, r *http.Request) error {
|
|||
return httputil.NewError(http.StatusBadRequest, err)
|
||||
}
|
||||
|
||||
if r.FormValue(urlutil.QueryIsProgrammatic) == "true" {
|
||||
newSession.Programmatic = true
|
||||
}
|
||||
|
||||
// sign the route session, as a JWT
|
||||
signedJWT, err := state.sharedEncoder.Marshal(newSession)
|
||||
if err != nil {
|
||||
|
@ -535,7 +530,6 @@ func (a *Authenticate) saveSessionToDataBroker(
|
|||
options := a.options.Load()
|
||||
|
||||
sessionExpiry := timestamppb.New(time.Now().Add(options.CookieExpire))
|
||||
sessionState.Expiry = jwt.NewNumericDate(sessionExpiry.AsTime())
|
||||
idTokenIssuedAt := timestamppb.New(sessionState.IssuedAt.Time())
|
||||
|
||||
s := &session.Session{
|
||||
|
@ -576,7 +570,8 @@ func (a *Authenticate) saveSessionToDataBroker(
|
|||
if err != nil {
|
||||
return fmt.Errorf("authenticate: error saving session: %w", err)
|
||||
}
|
||||
sessionState.Version = sessions.Version(fmt.Sprint(res.GetServerVersion()))
|
||||
sessionState.DatabrokerServerVersion = res.GetServerVersion()
|
||||
sessionState.DatabrokerRecordVersion = res.GetRecord().GetVersion()
|
||||
|
||||
_, err = state.directoryClient.RefreshUser(ctx, &directory.RefreshUserRequest{
|
||||
UserId: s.UserId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue