searchparam

This commit is contained in:
Max Peintner
2023-05-24 14:28:55 +02:00
parent c6050d0739
commit 4ec963847d
2 changed files with 7 additions and 3 deletions

View File

@@ -4,11 +4,15 @@ import PasswordForm from "#/ui/PasswordForm";
import UserAvatar from "#/ui/UserAvatar";
import { getMostRecentCookieWithLoginname } from "#/utils/cookies";
export default async function Page({ searchParams }: { searchParams: any }) {
export default async function Page({
searchParams,
}: {
searchParams: Record<string | number | symbol, string | undefined>;
}) {
const { loginName } = searchParams;
const sessionFactors = await loadSession(loginName);
async function loadSession(loginName: string) {
async function loadSession(loginName?: string) {
try {
const recent = await getMostRecentCookieWithLoginname(loginName);

View File

@@ -13,7 +13,7 @@ type Inputs = {
};
type Props = {
loginName: string;
loginName?: string;
};
export default function PasswordForm({ loginName }: Props) {