Restrict team owner assignment to admins
This commit is contained in:
1 parent
44c6b4427f
commit
5bf1792b38
1 file changed
+1
-1
@@ -47,7 +47,7 @@ export async function POST(request: Request) {
|
|||||||
const { name, ownerId } = body;
|
const { name, ownerId } = body;
|
||||||
|
|
||||||
const teamId = uuid();
|
const teamId = uuid();
|
||||||
const teamOwnerId = ownerId ?? auth.user.id;
|
const teamOwnerId = ownerId && auth.user.isAdmin ? ownerId : auth.user.id;
|
||||||
|
|
||||||
const team = await createTeam(
|
const team = await createTeam(
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in new issue
Block a user