|
2 | 2 | import { TeamMemberSearchTable } from '@/components/data-table/team-member-search-table'; |
3 | 3 | import { TeamMemberTable } from '@/components/data-table/team-member-table'; |
4 | 4 | import { InputField } from '@/components/form-fields'; |
| 5 | +import { ActionDialog, Button, Form, Separator } from '@/components/ui'; |
5 | 6 | import { yupResolver } from '@hookform/resolvers/yup'; |
6 | 7 | import { ServerTeam } from '@stackframe/stack'; |
7 | 8 | import { strictEmailSchema, yupObject } from '@stackframe/stack-shared/dist/schema-fields'; |
8 | 9 | import { runAsynchronouslyWithAlert } from '@stackframe/stack-shared/dist/utils/promises'; |
9 | | -import { ActionDialog, Button, Form, Separator } from '@/components/ui'; |
10 | 10 | import { notFound } from 'next/navigation'; |
11 | 11 | import { useState } from 'react'; |
12 | 12 | import { useForm } from 'react-hook-form'; |
@@ -39,10 +39,11 @@ export function AddUserDialog(props: { |
39 | 39 | e?.preventDefault(); |
40 | 40 | setSubmitting(true); |
41 | 41 | try { |
42 | | - const domain = project.config.domains[0]?.domain; |
| 42 | + // TODO: Let the user choose which domain to use, or use a "primary domain" concept |
| 43 | + const domain = project.config.domains.find(d => !d.domain.includes('*'))?.domain; |
43 | 44 | if (!domain) { |
44 | 45 | // TODO don't use JS alert for this, make the UX nicer |
45 | | - alert("You must configure at least one domain for this project before you can invite users."); |
| 46 | + alert("You must configure at least one non-wildcard domain for this project before you can invite users."); |
46 | 47 | return; |
47 | 48 | } |
48 | 49 | await props.team.inviteUser({ |
|
0 commit comments