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:
Caleb Doxsey 2022-02-09 10:59:06 -07:00 committed by GitHub
parent 0898dd4f34
commit 46c4d5fa7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 59 additions and 126 deletions

View file

@ -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,