Skip to content

Commit 4630827

Browse files
committed
fe: Add logout button to onboarding
If the user does not have an existing org
1 parent 65a41e7 commit 4630827

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

clients/apps/web/src/components/Onboarding/OrganizationStep.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useAuth } from '@/hooks'
55
import { usePostHog } from '@/hooks/posthog'
66
import { useCreateOrganization } from '@/hooks/queries'
77
import { setValidationErrors } from '@/utils/api/errors'
8+
import { CONFIG } from '@/utils/config'
89
import { FormControl } from '@mui/material'
910
import { schemas } from '@polar-sh/client'
1011
import Button from '@polar-sh/ui/components/atoms/Button'
@@ -344,12 +345,22 @@ export const OrganizationStep = ({
344345
>
345346
Create
346347
</Button>
347-
{hasExistingOrg && (
348+
{hasExistingOrg ? (
348349
<Link href={`/dashboard`} className="w-full">
349350
<Button variant="secondary" fullWidth>
350351
Back to Dashboard
351352
</Button>
352353
</Link>
354+
) : (
355+
<Link
356+
href={`${CONFIG.BASE_URL}/v1/auth/logout`}
357+
prefetch={false}
358+
className="w-full"
359+
>
360+
<Button variant="secondary" fullWidth>
361+
Logout
362+
</Button>
363+
</Link>
353364
)}
354365
</FadeUp>
355366
</form>

0 commit comments

Comments
 (0)