Add API key authentication for external access
Some checks failed
Lint and Build / build (pull_request) Failing after 1m44s
Some checks failed
Lint and Build / build (pull_request) Failing after 1m44s
- Create API key context for managing authentication state - Add dedicated settings page for API key management - Move performance metrics to dedicated page in navigation - Update middleware to support URL parameter fallback - Enhance UI with proper glass morphism styling - Add Solarized color utilities to CSS - Improve spacing and padding throughout UI components - Remove manual bullet points from list items 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
4f9e6d2097
commit
bc4cfe607d
10 changed files with 620 additions and 48 deletions
|
@ -1,14 +1,13 @@
|
|||
// API client utility for making authenticated requests
|
||||
|
||||
// Get API key from environment (client-side will need to be provided differently)
|
||||
// Get API key from environment or localStorage
|
||||
function getApiKey(): string | null {
|
||||
if (typeof window === 'undefined') {
|
||||
// Server-side
|
||||
return process.env.API_KEY || null;
|
||||
} else {
|
||||
// Client-side - for now, return null to bypass auth in development
|
||||
// In production, this would come from a secure storage or context
|
||||
return null;
|
||||
// Client-side - get from localStorage
|
||||
return localStorage.getItem('obs-api-key') || null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue