join team should be authenticated (#144)
This commit is contained in:
@@ -1,10 +1,16 @@
|
|||||||
"use client";
|
|
||||||
|
|
||||||
import JoinTeam from "~/components/team/JoinTeam";
|
import JoinTeam from "~/components/team/JoinTeam";
|
||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
import Spinner from "@unsend/ui/src/spinner";
|
import Spinner from "@unsend/ui/src/spinner";
|
||||||
|
import { getServerAuthSession } from "~/server/auth";
|
||||||
|
import { redirect } from "next/navigation";
|
||||||
|
|
||||||
|
export default async function CreateTeam() {
|
||||||
|
const session = await getServerAuthSession();
|
||||||
|
|
||||||
|
if (!session) {
|
||||||
|
redirect("/login");
|
||||||
|
}
|
||||||
|
|
||||||
export default function CreateTeam() {
|
|
||||||
return (
|
return (
|
||||||
<div className="flex items-center justify-center min-h-screen ">
|
<div className="flex items-center justify-center min-h-screen ">
|
||||||
<div className=" w-[300px] flex flex-col gap-8">
|
<div className=" w-[300px] flex flex-col gap-8">
|
||||||
|
@@ -78,7 +78,10 @@ async function sendMail(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const domain = domains[0];
|
const fromEmailDomain = env.FROM_EMAIL?.split("@")[1];
|
||||||
|
|
||||||
|
const domain =
|
||||||
|
domains.find((d) => d.name === fromEmailDomain) ?? domains[0];
|
||||||
|
|
||||||
await sendEmail({
|
await sendEmail({
|
||||||
teamId: team.id,
|
teamId: team.id,
|
||||||
|
Reference in New Issue
Block a user