mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-04 21:04:37 +08:00
Fix domain logic when inviting users
This commit is contained in:
parent
3b33048a44
commit
2e1634ea46
@ -2,11 +2,11 @@
|
||||
import { TeamMemberSearchTable } from '@/components/data-table/team-member-search-table';
|
||||
import { TeamMemberTable } from '@/components/data-table/team-member-table';
|
||||
import { InputField } from '@/components/form-fields';
|
||||
import { ActionDialog, Button, Form, Separator } from '@/components/ui';
|
||||
import { yupResolver } from '@hookform/resolvers/yup';
|
||||
import { ServerTeam } from '@stackframe/stack';
|
||||
import { strictEmailSchema, yupObject } from '@stackframe/stack-shared/dist/schema-fields';
|
||||
import { runAsynchronouslyWithAlert } from '@stackframe/stack-shared/dist/utils/promises';
|
||||
import { ActionDialog, Button, Form, Separator } from '@/components/ui';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { useState } from 'react';
|
||||
import { useForm } from 'react-hook-form';
|
||||
@ -39,10 +39,11 @@ export function AddUserDialog(props: {
|
||||
e?.preventDefault();
|
||||
setSubmitting(true);
|
||||
try {
|
||||
const domain = project.config.domains[0]?.domain;
|
||||
// TODO: Let the user choose which domain to use, or use a "primary domain" concept
|
||||
const domain = project.config.domains.find(d => !d.domain.includes('*'))?.domain;
|
||||
if (!domain) {
|
||||
// TODO don't use JS alert for this, make the UX nicer
|
||||
alert("You must configure at least one domain for this project before you can invite users.");
|
||||
alert("You must configure at least one non-wildcard domain for this project before you can invite users.");
|
||||
return;
|
||||
}
|
||||
await props.team.inviteUser({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user