mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
## Changes 🏗️ - Refactor homepage redirect logic to always point to `/` - the `/` route handles whether to redirect to `/copilot` or `/library` based on flag - Simplify `useGetFlag` checks - Add `<FeatureFlagRedirect />` and `<FeatureFlagPage />` wrapper components - helpers to do 1 thing or the other, depending on chat enabled/disabled - avoids boilerplate code, checking flagss and redirects mistakes (especially around race conditions with LD init ) ## Checklist 📋 ### For code changes: - [x] I have clearly listed my changes in the PR description - [x] I have made a test plan - [x] I have tested my changes according to the test plan: - [x] Log in / out of AutoGPT with flag disabled/enabled - [x] Sign up to AutoGPT with flag disabled/enabled - [x] Redirects to homepage always work `/` - [x] Can't access Copilot with disabled flag
14 lines
334 B
TypeScript
14 lines
334 B
TypeScript
/**
|
|
* Shared constants for the frontend application
|
|
*/
|
|
|
|
// Admin impersonation
|
|
export const IMPERSONATION_HEADER_NAME = "X-Act-As-User-Id";
|
|
export const IMPERSONATION_STORAGE_KEY = "admin-impersonate-user-id";
|
|
|
|
// API key authentication
|
|
export const API_KEY_HEADER_NAME = "X-API-Key";
|
|
|
|
// Layout
|
|
export const NAVBAR_HEIGHT_PX = 60;
|