improve email formatting and invite flow for new users

This commit is contained in:
Milo Schwartz
2024-12-31 18:25:11 -05:00
parent d244d6003b
commit d447de9e8a
15 changed files with 107 additions and 89 deletions

View File

@@ -304,8 +304,8 @@ export default function ReverseProxyTargets(props: {
{row.original.method}
</SelectTrigger>
<SelectContent>
<SelectItem value="http">http</SelectItem>
<SelectItem value="https">https</SelectItem>
<SelectItem value="http">HTTP</SelectItem>
<SelectItem value="https">HTTPS</SelectItem>
</SelectContent>
</Select>
)

View File

@@ -5,19 +5,34 @@ import {
CardContent,
CardDescription,
CardHeader,
CardTitle,
CardTitle
} from "@/components/ui/card";
import { createApiClient } from "@app/api";
import LoginForm from "@app/components/LoginForm";
import { useEnvContext } from "@app/hooks/useEnvContext";
import { useRouter } from "next/navigation";
import { useEffect } from "react";
type DashboardLoginFormProps = {
redirect?: string;
};
export default function DashboardLoginForm({
redirect,
redirect
}: DashboardLoginFormProps) {
const router = useRouter();
// const api = createApiClient(useEnvContext());
//
// useEffect(() => {
// const logout = async () => {
// try {
// await api.post("/auth/logout");
// console.log("user logged out");
// } catch (e) {}
// };
//
// logout();
// });
return (
<Card className="w-full max-w-md">

View File

@@ -20,10 +20,6 @@ export default async function InvitePage(props: {
const user = await verifySession();
if (!user) {
redirect(`/auth/signup?redirect=/invite?token=${params.token}`);
}
const parts = tokenParam.split("-");
if (parts.length !== 2) {
return (
@@ -70,9 +66,17 @@ export default async function InvitePage(props: {
}
}
const type = cardType();
console.log("card type is", type, error)
if (!user && type === "user_does_not_exist") {
redirect(`/auth/signup?redirect=/invite?token=${params.token}`);
}
return (
<>
<InviteStatusCard type={cardType()} token={tokenParam} />
<InviteStatusCard type={type} token={tokenParam} />
</>
);
}