@@ -202,7 +202,7 @@ func (c *AuthflowController) HandleStartOfFlow(
202202 handleWithScreen (screen )
203203}
204204
205- func (c * AuthflowController ) isExpectedWebSessionError (err error ) bool {
205+ func (c * AuthflowController ) isWebSessionNotFoundOrCompletedError (err error ) bool {
206206 return apierrors .IsKind (err , webapp .WebUIInvalidSession ) || apierrors .IsKind (err , webapp .WebUISessionCompleted )
207207}
208208
@@ -211,7 +211,7 @@ func (c *AuthflowController) HandleOAuthCallback(ctx context.Context, w http.Res
211211
212212 s , err := c .Sessions .Get (ctx , state .WebSessionID )
213213 if err != nil {
214- if ! c .isExpectedWebSessionError (err ) {
214+ if ! c .isWebSessionNotFoundOrCompletedError (err ) {
215215 c .Logger .WithError (err ).Errorf ("failed to get web session" )
216216 }
217217 c .renderError (ctx , w , r , err )
@@ -313,7 +313,7 @@ func (c *AuthflowController) HandleStep(ctx context.Context, w http.ResponseWrit
313313
314314 s , err := c .getWebSession (ctx )
315315 if err != nil {
316- if ! c .isExpectedWebSessionError (err ) {
316+ if ! c .isWebSessionNotFoundOrCompletedError (err ) {
317317 c .Logger .WithError (err ).Errorf ("failed to get web session" )
318318 }
319319 c .renderError (ctx , w , r , err )
@@ -345,7 +345,7 @@ func (c *AuthflowController) HandleWithoutFlow(ctx context.Context, w http.Respo
345345 var session * webapp.Session
346346 s , err := c .getWebSession (ctx )
347347 if err != nil {
348- if ! c .isExpectedWebSessionError (err ) {
348+ if ! c .isWebSessionNotFoundOrCompletedError (err ) {
349349 c .Logger .WithError (err ).Errorf ("failed to get web session" )
350350 }
351351 } else {
@@ -384,7 +384,8 @@ func (c *AuthflowController) getOrCreateWebSession(ctx context.Context, w http.R
384384 if err == nil && s != nil {
385385 return s , nil
386386 }
387- if ! errors .Is (err , webapp .ErrSessionNotFound ) {
387+
388+ if ! c .isWebSessionNotFoundOrCompletedError (err ) {
388389 return nil , err
389390 }
390391
0 commit comments