mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-13 08:15:21 +02:00
feat: add authentication for OSS (#167)
* feat: add authentication for OSS Fixes #157 and #156 * fix: fix token generation * fix: limit fastapi workers to 1
This commit is contained in:
parent
0791975864
commit
642cc34e8c
48 changed files with 994 additions and 303 deletions
|
|
@ -20,12 +20,14 @@ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, D
|
|||
import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { useAppConfig } from '@/context/AppConfigContext';
|
||||
import { useAuth } from '@/lib/auth';
|
||||
import logger from '@/lib/logger';
|
||||
import { isOSSMode } from '@/lib/utils';
|
||||
|
||||
export default function APIKeysPage() {
|
||||
const { user, getAccessToken, redirectToLogin, loading } = useAuth();
|
||||
const { config } = useAppConfig();
|
||||
const isOSS = config?.deploymentMode === 'oss';
|
||||
|
||||
logger.debug('[APIKeysPage] Component render', {
|
||||
loading,
|
||||
|
|
@ -313,8 +315,8 @@ export default function APIKeysPage() {
|
|||
|
||||
// In OSS mode, check if there's already an active service key
|
||||
const activeServiceKeys = serviceKeys.filter(key => !key.archived_at);
|
||||
const canCreateServiceKey = !isOSSMode() || activeServiceKeys.length === 0;
|
||||
const showServiceKeyArchiveControls = !isOSSMode();
|
||||
const canCreateServiceKey = !isOSS || activeServiceKeys.length === 0;
|
||||
const showServiceKeyArchiveControls = !isOSS;
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-background">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue