Skip to content

Commit 2556eea

Browse files
authored
feat: do not swap authorization headers (#856)
Use original access token when forwarding requests to backend APIs.
1 parent 5f64de5 commit 2556eea

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

internal/sessions/session_store.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ func (sessions *SessionStore) getFromHeaders(c echo.Context) (*models.Session, e
239239
TokenIDs: tokenIDs,
240240
}
241241
c.Set(SessionCtxKey, &session)
242-
// remove the authorization header, it will be re-populated if needed
243-
c.Request().Header.Del(echo.HeaderAuthorization)
242+
// Re-set the authorization header
243+
c.Request().Header.Set(echo.HeaderAuthorization, accessToken)
244244
return &session, nil
245245
}
246246
}
@@ -262,8 +262,8 @@ func (sessions *SessionStore) getFromBasicAuth(c echo.Context) (*models.Session,
262262
TokenIDs: tokenIDs,
263263
}
264264
c.Set(SessionCtxKey, &session)
265-
// remove the authorization header, it will be re-populated if needed
266-
c.Request().Header.Del(echo.HeaderAuthorization)
265+
// Re-set the authorization header
266+
c.Request().Header.Set(echo.HeaderAuthorization, basicAuthPwd)
267267
return &session, nil
268268
}
269269
}

0 commit comments

Comments
 (0)