Skip to content

Commit 2e1634e

Browse files
committed
Fix domain logic when inviting users
1 parent 3b33048 commit 2e1634e

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

  • apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/teams/[teamId]

apps/dashboard/src/app/(main)/(protected)/projects/[projectId]/teams/[teamId]/page-client.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import { TeamMemberSearchTable } from '@/components/data-table/team-member-search-table';
33
import { TeamMemberTable } from '@/components/data-table/team-member-table';
44
import { InputField } from '@/components/form-fields';
5+
import { ActionDialog, Button, Form, Separator } from '@/components/ui';
56
import { yupResolver } from '@hookform/resolvers/yup';
67
import { ServerTeam } from '@stackframe/stack';
78
import { strictEmailSchema, yupObject } from '@stackframe/stack-shared/dist/schema-fields';
89
import { runAsynchronouslyWithAlert } from '@stackframe/stack-shared/dist/utils/promises';
9-
import { ActionDialog, Button, Form, Separator } from '@/components/ui';
1010
import { notFound } from 'next/navigation';
1111
import { useState } from 'react';
1212
import { useForm } from 'react-hook-form';
@@ -39,10 +39,11 @@ export function AddUserDialog(props: {
3939
e?.preventDefault();
4040
setSubmitting(true);
4141
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;
4344
if (!domain) {
4445
// 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.");
4647
return;
4748
}
4849
await props.team.inviteUser({

0 commit comments

Comments
 (0)