diff --git a/lib/auth/sessions.go b/lib/auth/sessions.go index 2676f7fff5ec8..51f16cd508010 100644 --- a/lib/auth/sessions.go +++ b/lib/auth/sessions.go @@ -473,18 +473,13 @@ func (a *Server) generateAppToken(ctx context.Context, username string, roles [] return token, nil } -func (a *Server) CreateSessionCert(user services.UserState, sessionTTL time.Duration, publicKey []byte, compatibility, routeToCluster, kubernetesCluster, loginIP string, attestationReq *keys.AttestationStatement) ([]byte, []byte, error) { +func (a *Server) CreateSessionCert(userState services.UserState, sessionTTL time.Duration, publicKey []byte, compatibility, routeToCluster, kubernetesCluster, loginIP string, attestationReq *keys.AttestationStatement) ([]byte, []byte, error) { // It's safe to extract the access info directly from services.User because // this occurs during the initial login before the first certs have been // generated, so there's no possibility of any active access requests. ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second) defer cancel() - userState, err := a.GetUserOrLoginState(ctx, user.GetName()) - if err != nil { - return nil, nil, trace.Wrap(err) - } - accessInfo := services.AccessInfoFromUserState(userState) clusterName, err := a.GetClusterName() if err != nil {