improve verify email redirect flow

This commit is contained in:
Milo Schwartz
2024-11-28 00:11:13 -05:00
parent c2cbd7e1a1
commit 5bbf32f6a6
18 changed files with 145 additions and 83 deletions

View File

@@ -14,27 +14,6 @@ export default async function OrgPage(props: OrgPageProps) {
const params = await props.params;
const orgId = params.orgId;
const getUser = cache(verifySession);
const user = await getUser();
if (!user) {
redirect("/auth/login");
}
const cookie = await authCookieHeader();
try {
const getOrgUser = cache(() =>
internal.get<AxiosResponse<GetOrgUserResponse>>(
`/org/${orgId}/user/${user.userId}`,
cookie
)
);
const orgUser = await getOrgUser();
} catch {
redirect(`/`);
}
return (
<>
<p>Welcome to {orgId} dashboard</p>