diff --git a/.gitignore b/.gitignore
index eb5de29e..ef585ed0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
node_modules
+package-lock.json
.next
out
dist
diff --git a/app/(auth)/link-account/LinkAccountClient.tsx b/app/(auth)/link-account/LinkAccountClient.tsx
index eb5128c4..bd9d6be6 100644
--- a/app/(auth)/link-account/LinkAccountClient.tsx
+++ b/app/(auth)/link-account/LinkAccountClient.tsx
@@ -2,7 +2,7 @@
import { useState, FormEvent } from "react";
import { useRouter } from "next/navigation";
-import { signIn } from "next-auth/react";
+import { authClient } from "@/src/lib/auth-client";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
@@ -45,7 +45,7 @@ export default function LinkAccountClient({
return;
}
- await signIn(provider, { callbackUrl: "/" });
+ await authClient.signIn.social({ provider, callbackURL: "/" });
} catch {
setError("An error occurred while linking your account");
setLoading(false);
diff --git a/app/(auth)/login/LoginClient.tsx b/app/(auth)/login/LoginClient.tsx
index 2ea6edf1..c5143510 100644
--- a/app/(auth)/login/LoginClient.tsx
+++ b/app/(auth)/login/LoginClient.tsx
@@ -2,7 +2,7 @@
import { useRouter } from "next/navigation";
import { FormEvent, useState } from "react";
-import { signIn } from "next-auth/react";
+import { authClient } from "@/src/lib/auth-client";
import { LogIn } from "lucide-react";
import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";
@@ -36,28 +36,24 @@ export default function LoginClient({ enabledProviders = [] }: LoginClientProps)
return;
}
- const result = await signIn("credentials", {
- redirect: false,
- callbackUrl: "/",
+ const { data, error } = await authClient.signIn.username({
username,
password,
});
- if (!result || result.error || result.ok === false) {
+ if (error) {
let message: string | null = null;
- if (result?.status === 429) {
- message = result.error && result.error !== "CredentialsSignin"
- ? result.error
- : "Too many login attempts. Try again in a few minutes.";
- } else if (result?.error && result.error !== "CredentialsSignin") {
- message = result.error;
+ if (error.status === 429) {
+ message = error.message || "Too many login attempts. Try again in a few minutes.";
+ } else if (error.message) {
+ message = error.message;
}
setLoginError(message ?? "Invalid username or password.");
setLoginPending(false);
return;
}
- router.replace(result.url ?? "/");
+ router.replace("/");
router.refresh();
};
@@ -65,7 +61,7 @@ export default function LoginClient({ enabledProviders = [] }: LoginClientProps)
setLoginError(null);
setOauthPending(providerId);
try {
- await signIn(providerId, { callbackUrl: "/" });
+ await authClient.signIn.social({ provider: providerId, callbackURL: "/" });
} catch {
setLoginError("Failed to sign in with OAuth");
setOauthPending(null);
diff --git a/app/(auth)/login/page.tsx b/app/(auth)/login/page.tsx
index 0bb940e5..972a4a5d 100644
--- a/app/(auth)/login/page.tsx
+++ b/app/(auth)/login/page.tsx
@@ -1,6 +1,6 @@
import { redirect } from "next/navigation";
import { auth } from "@/src/lib/auth";
-import { getEnabledOAuthProviders } from "@/src/lib/config";
+import { getProviderDisplayList } from "@/src/lib/models/oauth-providers";
import LoginClient from "./LoginClient";
export default async function LoginPage() {
@@ -9,7 +9,7 @@ export default async function LoginPage() {
redirect("/");
}
- const enabledProviders = getEnabledOAuthProviders();
+ const enabledProviders = await getProviderDisplayList();
return
{entry.username}
- Added {new Date(entry.created_at).toLocaleDateString()} + Added {new Date(entry.createdAt).toLocaleDateString()}
{r.summary}
diff --git a/app/(dashboard)/audit-log/page.tsx b/app/(dashboard)/audit-log/page.tsx index 1ea35df1..af06bccc 100644 --- a/app/(dashboard)/audit-log/page.tsx +++ b/app/(dashboard)/audit-log/page.tsx @@ -28,11 +28,11 @@ export default async function AuditLogPage({ searchParams }: PageProps) {{c.domain_names.join(", ")}
+{c.domainNames.join(", ")}
), }, { diff --git a/app/(dashboard)/certificates/page.tsx b/app/(dashboard)/certificates/page.tsx index e86b96d6..d9db6d6a 100644 --- a/app/(dashboard)/certificates/page.tsx +++ b/app/(dashboard)/certificates/page.tsx @@ -22,7 +22,7 @@ export type AcmeHost = { id: number; name: string; domains: string[]; - ssl_forced: boolean; + sslForced: boolean; enabled: boolean; }; @@ -37,7 +37,7 @@ export type ImportedCertView = { usedBy: { id: number; name: string; domains: string[] }[]; }; -export type ManagedCertView = { id: number; name: string; domain_names: string[] }; +export type ManagedCertView = { id: number; name: string; domainNames: string[] }; const PER_PAGE = 25; @@ -124,7 +124,7 @@ export default async function CertificatesPage({ searchParams }: PageProps) { id: r.id, name: r.name, domains: JSON.parse(r.domains) as string[], - ssl_forced: r.sslForced, + sslForced: r.sslForced, enabled: r.enabled, })); @@ -143,9 +143,9 @@ export default async function CertificatesPage({ searchParams }: PageProps) { const importedCerts: ImportedCertView[] = []; const managedCerts: ManagedCertView[] = []; const issuedByCa = issuedClientCerts.reduce