Skip to content

Commit

Permalink
fix(ui): logout (#849)
Browse files Browse the repository at this point in the history
* Fix logout
  • Loading branch information
andrewrisse committed Jul 29, 2024
1 parent cc18cea commit f71af5d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
12 changes: 12 additions & 0 deletions packages/ui/chart/templates/ui/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@ spec:
value: '###ZARF_VAR_DISABLE_KEYCLOAK###'
- name: PUBLIC_MESSAGE_LENGTH_LIMIT
value: '###ZARF_VAR_MESSAGE_LENGTH_LIMIT###'
- name: SUPABASE_AUTH_EXTERNAL_KEYCLOAK_URL
value: "https://sso.{{ .Values.package.domain }}/realms/uds"
- name: SUPABASE_AUTH_KEYCLOAK_CLIENT_ID
valueFrom:
secretKeyRef:
name: sso-client-uds-supabase
key: clientId
- name: SUPABASE_AUTH_KEYCLOAK_SECRET
valueFrom:
secretKeyRef:
name: sso-client-uds-supabase
key: secret
resources:
requests:
memory: '0'
Expand Down
10 changes: 5 additions & 5 deletions src/leapfrogai_ui/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ PUBLIC_SUPABASE_ANON_KEY=<anon_key>
PUBLIC_DISABLE_KEYCLOAK=false
PUBLIC_MESSAGE_LENGTH_LIMIT=10000


# PRIVATE DYNAMIC
DEFAULT_TEMPERATURE=0.1
DEFAULT_SYSTEM_PROMPT="You are a helpful AI assistant created by Defense Unicorns."
DEFAULT_MODEL=vllm #for OpenAI it could be: gpt-3.5-turbo
LEAPFROGAI_API_BASE_URL=https://leapfrogai-api.uds.dev #for OpenAI it would be: https://api.openai.com
#If specified, app will use OpenAI instead of Leapfrog
OPENAI_API_KEY=

# SUPABASE AUTH (when running Supabase Locally)
SUPABASE_AUTH_EXTERNAL_KEYCLOAK_URL=https://sso.uds.dev/realms/uds
SUPABASE_AUTH_KEYCLOAK_CLIENT_ID=uds-supabase
SUPABASE_AUTH_KEYCLOAK_SECRET=<secret>
SUPABASE_AUTH_EXTERNAL_KEYCLOAK_URL=https://sso.uds.dev/realms/uds

#If specified, app will use OpenAI instead of Leapfrog
OPENAI_API_KEY=

# PLAYWRIGHT
USERNAME=user1@test.com
Expand Down
4 changes: 2 additions & 2 deletions src/leapfrogai_ui/tests/logout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ test('it can log out', async ({ page }) => {
if (process.env.PUBLIC_DISABLE_KEYCLOAK === 'true') {
await expect(page.getByText('Sign In')).toBeVisible();
} else {
const loginBtn = page.getByText('Log In');
const loginBtn = page.getByRole('button', { name: /Log In with UDS SSO/i });
await expect(loginBtn).toBeVisible();
await loginBtn.click();
await page.waitForURL(`${process.env.SUPABASE_AUTH_EXTERNAL_KEYCLOAK_URL!}/**/*`);
await page.waitForURL(`**/*/realms/uds/**/*`); // ensure full logout of keycloak (not just supabase)
}
});

0 comments on commit f71af5d

Please sign in to comment.