mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-03-18 12:42:02 +00:00
chore: review comments
This commit is contained in:
@@ -24,9 +24,9 @@ export const DomainWarning = (props: Props) => {
|
|||||||
const redirectUri = searchParams.get("redirect_uri");
|
const redirectUri = searchParams.get("redirect_uri");
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card role="alert" aria-live="assertive" className="min-w-xs sm:min-w-sm">
|
<Card role="alert" aria-live="assertive">
|
||||||
<CardHeader>
|
<CardHeader className="gap-1.5">
|
||||||
<CardTitle className="text-3xl">{t("domainWarningTitle")}</CardTitle>
|
<CardTitle className="text-xl">{t("domainWarningTitle")}</CardTitle>
|
||||||
<CardDescription>
|
<CardDescription>
|
||||||
<Trans
|
<Trans
|
||||||
t={t}
|
t={t}
|
||||||
@@ -37,7 +37,7 @@ export const DomainWarning = (props: Props) => {
|
|||||||
/>
|
/>
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardFooter className="flex flex-col items-stretch gap-2">
|
<CardFooter className="flex flex-col items-stretch gap-3">
|
||||||
<Button onClick={onClick} variant="warning">
|
<Button onClick={onClick} variant="warning">
|
||||||
{t("ignoreTitle")}
|
{t("ignoreTitle")}
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const BaseLayout = ({ children }: { children: React.ReactNode }) => {
|
|||||||
<ThemeToggle />
|
<ThemeToggle />
|
||||||
<LanguageSelector />
|
<LanguageSelector />
|
||||||
</div>
|
</div>
|
||||||
<div className="max-w-sm">{children}</div>
|
<div className="max-w-sm md:min-w-sm min-w-xs">{children}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ export const AuthorizePage = () => {
|
|||||||
return (
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
<CardHeader className="mb-2">
|
<CardHeader className="mb-2">
|
||||||
<div className="flex flex-col gap-3 items-center justify-center">
|
<div className="flex flex-col gap-3 items-center justify-center text-center">
|
||||||
<div className="bg-accent-foreground text-muted text-xl font-bold font-sans rounded-lg px-4 py-3">
|
<div className="bg-accent-foreground text-muted text-xl font-bold font-sans rounded-lg px-4 py-3">
|
||||||
{getClientInfo.data?.name.slice(0, 1)}
|
{getClientInfo.data?.name.slice(0, 1)}
|
||||||
</div>
|
</div>
|
||||||
@@ -163,7 +163,7 @@ export const AuthorizePage = () => {
|
|||||||
app: getClientInfo.data?.name || "Unknown",
|
app: getClientInfo.data?.name || "Unknown",
|
||||||
})}
|
})}
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
<CardDescription className="text-sm max-w-sm text-center">
|
<CardDescription className="text-sm max-w-sm">
|
||||||
{scopes.includes("openid")
|
{scopes.includes("openid")
|
||||||
? t("authorizeSubtitle")
|
? t("authorizeSubtitle")
|
||||||
: t("authorizeSubtitleOAuth")}
|
: t("authorizeSubtitleOAuth")}
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ export const ContinuePage = () => {
|
|||||||
if (showUntrustedWarning) {
|
if (showUntrustedWarning) {
|
||||||
return (
|
return (
|
||||||
<Card role="alert" aria-live="assertive">
|
<Card role="alert" aria-live="assertive">
|
||||||
<CardHeader>
|
<CardHeader className="gap-1.5">
|
||||||
<CardTitle className="text-xl">
|
<CardTitle className="text-xl">
|
||||||
{t("continueUntrustedRedirectTitle")}
|
{t("continueUntrustedRedirectTitle")}
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
@@ -133,8 +133,8 @@ export const ContinuePage = () => {
|
|||||||
if (showInsecureWarning) {
|
if (showInsecureWarning) {
|
||||||
return (
|
return (
|
||||||
<Card role="alert" aria-live="assertive">
|
<Card role="alert" aria-live="assertive">
|
||||||
<CardHeader>
|
<CardHeader className="gap-1.5">
|
||||||
<CardTitle className="text-3xl">
|
<CardTitle className="text-xl">
|
||||||
{t("continueInsecureRedirectTitle")}
|
{t("continueInsecureRedirectTitle")}
|
||||||
</CardTitle>
|
</CardTitle>
|
||||||
<CardDescription>
|
<CardDescription>
|
||||||
@@ -168,7 +168,7 @@ export const ContinuePage = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="min-w-xs">
|
<Card>
|
||||||
<CardHeader className="gap-1.5">
|
<CardHeader className="gap-1.5">
|
||||||
<CardTitle className="text-xl">
|
<CardTitle className="text-xl">
|
||||||
{t("continueRedirectingTitle")}
|
{t("continueRedirectingTitle")}
|
||||||
@@ -176,8 +176,8 @@ export const ContinuePage = () => {
|
|||||||
<CardDescription>{t("continueRedirectingSubtitle")}</CardDescription>
|
<CardDescription>{t("continueRedirectingSubtitle")}</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
{showRedirectButton && (
|
{showRedirectButton && (
|
||||||
<CardFooter className="flex flex-col items-stretch">
|
<CardFooter>
|
||||||
<Button onClick={handleRedirect}>
|
<Button className="w-full" onClick={handleRedirect}>
|
||||||
{t("continueRedirectManually")}
|
{t("continueRedirectManually")}
|
||||||
</Button>
|
</Button>
|
||||||
</CardFooter>
|
</CardFooter>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export const ErrorPage = () => {
|
|||||||
const error = searchParams.get("error") ?? "";
|
const error = searchParams.get("error") ?? "";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="min-w-xs">
|
<Card>
|
||||||
<CardHeader className="gap-1.5">
|
<CardHeader className="gap-1.5">
|
||||||
<CardTitle className="text-xl">{t("errorTitle")}</CardTitle>
|
<CardTitle className="text-xl">{t("errorTitle")}</CardTitle>
|
||||||
<CardDescription className="flex flex-col gap-3">
|
<CardDescription className="flex flex-col gap-3">
|
||||||
|
|||||||
@@ -2,16 +2,20 @@ import {
|
|||||||
Card,
|
Card,
|
||||||
CardContent,
|
CardContent,
|
||||||
CardDescription,
|
CardDescription,
|
||||||
|
CardFooter,
|
||||||
CardHeader,
|
CardHeader,
|
||||||
CardTitle,
|
CardTitle,
|
||||||
} from "@/components/ui/card";
|
} from "@/components/ui/card";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
import { useAppContext } from "@/context/app-context";
|
import { useAppContext } from "@/context/app-context";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import Markdown from "react-markdown";
|
import Markdown from "react-markdown";
|
||||||
|
import { useNavigate } from "react-router";
|
||||||
|
|
||||||
export const ForgotPasswordPage = () => {
|
export const ForgotPasswordPage = () => {
|
||||||
const { forgotPasswordMessage } = useAppContext();
|
const { forgotPasswordMessage } = useAppContext();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card>
|
<Card>
|
||||||
@@ -27,6 +31,17 @@ export const ForgotPasswordPage = () => {
|
|||||||
</Markdown>
|
</Markdown>
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
|
<CardFooter>
|
||||||
|
<Button
|
||||||
|
className="w-full"
|
||||||
|
variant="outline"
|
||||||
|
onClick={() => {
|
||||||
|
navigate("/login");
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("notFoundButton")}
|
||||||
|
</Button>
|
||||||
|
</CardFooter>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ export const LoginPage = () => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<Card className="md:min-w-sm">
|
<Card>
|
||||||
<CardHeader className="gap-1.5">
|
<CardHeader className="gap-1.5">
|
||||||
<CardTitle className="text-center text-xl">{title}</CardTitle>
|
<CardTitle className="text-center text-xl">{title}</CardTitle>
|
||||||
{providers.length > 0 && (
|
{providers.length > 0 && (
|
||||||
@@ -264,14 +264,16 @@ export const LoginPage = () => {
|
|||||||
)}
|
)}
|
||||||
</CardContent>
|
</CardContent>
|
||||||
<CardFooter>
|
<CardFooter>
|
||||||
<Button
|
{userAuthConfigured && (
|
||||||
className="w-full"
|
<Button
|
||||||
type="submit"
|
className="w-full"
|
||||||
form={formId}
|
type="submit"
|
||||||
loading={loginIsPending || oauthIsPending}
|
form={formId}
|
||||||
>
|
loading={loginIsPending || oauthIsPending}
|
||||||
{t("loginSubmit")}
|
>
|
||||||
</Button>
|
{t("loginSubmit")}
|
||||||
|
</Button>
|
||||||
|
)}
|
||||||
</CardFooter>
|
</CardFooter>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ export const LogoutPage = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="min-w-xs">
|
<Card>
|
||||||
<CardHeader className="gap-1.5">
|
<CardHeader className="gap-1.5">
|
||||||
<CardTitle className="text-xl">{t("logoutTitle")}</CardTitle>
|
<CardTitle className="text-xl">{t("logoutTitle")}</CardTitle>
|
||||||
<CardDescription>
|
<CardDescription>
|
||||||
@@ -84,8 +84,10 @@ export const LogoutPage = () => {
|
|||||||
)}
|
)}
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardFooter className="flex flex-col items-stretch">
|
<CardFooter>
|
||||||
<Button
|
<Button
|
||||||
|
className="w-full"
|
||||||
|
variant="outline"
|
||||||
loading={logoutMutation.isPending}
|
loading={logoutMutation.isPending}
|
||||||
onClick={() => logoutMutation.mutate()}
|
onClick={() => logoutMutation.mutate()}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -21,13 +21,18 @@ export const NotFoundPage = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="min-w-xs">
|
<Card>
|
||||||
<CardHeader className="gap-1.5">
|
<CardHeader className="gap-1.5">
|
||||||
<CardTitle className="text-xl">{t("notFoundTitle")}</CardTitle>
|
<CardTitle className="text-xl">{t("notFoundTitle")}</CardTitle>
|
||||||
<CardDescription>{t("notFoundSubtitle")}</CardDescription>
|
<CardDescription>{t("notFoundSubtitle")}</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardFooter className="flex flex-col items-stretch">
|
<CardFooter>
|
||||||
<Button onClick={handleRedirect} loading={loading}>
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
className="w-full"
|
||||||
|
onClick={handleRedirect}
|
||||||
|
loading={loading}
|
||||||
|
>
|
||||||
{t("notFoundButton")}
|
{t("notFoundButton")}
|
||||||
</Button>
|
</Button>
|
||||||
</CardFooter>
|
</CardFooter>
|
||||||
|
|||||||
@@ -83,8 +83,13 @@ export const TotpPage = () => {
|
|||||||
onSubmit={(values) => totpMutation.mutate(values)}
|
onSubmit={(values) => totpMutation.mutate(values)}
|
||||||
/>
|
/>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
<CardFooter className="flex flex-col items-stretch">
|
<CardFooter>
|
||||||
<Button form={formId} type="submit" loading={totpMutation.isPending}>
|
<Button
|
||||||
|
className="w-full"
|
||||||
|
form={formId}
|
||||||
|
type="submit"
|
||||||
|
loading={totpMutation.isPending}
|
||||||
|
>
|
||||||
{t("continueTitle")}
|
{t("continueTitle")}
|
||||||
</Button>
|
</Button>
|
||||||
</CardFooter>
|
</CardFooter>
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ export const UnauthorizedPage = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card className="min-w-xs">
|
<Card>
|
||||||
<CardHeader className="gap-1.5">
|
<CardHeader className="gap-1.5">
|
||||||
<CardTitle className="text-xl">{t("unauthorizedTitle")}</CardTitle>
|
<CardTitle className="text-xl">{t("unauthorizedTitle")}</CardTitle>
|
||||||
<CardDescription>
|
<CardDescription>
|
||||||
@@ -65,8 +65,13 @@ export const UnauthorizedPage = () => {
|
|||||||
/>
|
/>
|
||||||
</CardDescription>
|
</CardDescription>
|
||||||
</CardHeader>
|
</CardHeader>
|
||||||
<CardFooter className="flex flex-col items-stretch">
|
<CardFooter>
|
||||||
<Button onClick={handleRedirect} loading={loading}>
|
<Button
|
||||||
|
variant="outline"
|
||||||
|
className="w-full"
|
||||||
|
onClick={handleRedirect}
|
||||||
|
loading={loading}
|
||||||
|
>
|
||||||
{t("unauthorizedButton")}
|
{t("unauthorizedButton")}
|
||||||
</Button>
|
</Button>
|
||||||
</CardFooter>
|
</CardFooter>
|
||||||
|
|||||||
Reference in New Issue
Block a user