mirror of
https://github.com/fosrl/pangolin.git
synced 2026-02-03 00:29:10 +00:00
improve email formatting and invite flow for new users
This commit is contained in:
@@ -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>
|
||||
)
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user