Fix TypeScript errors blocking Docker build
- Fix Authentik button type casting issue in login page * Use exported signIn instead of authClient type assertion * Add proper error handling for OAuth calls - Fix image MIME type handling in import-photo.ts * Convert base64 to data URL format for AI SDK compatibility - Fix type annotations in auth/server.ts changeEmail handler * Add explicit type annotation for destructured parameters These TypeScript errors were preventing 'pnpm build' from completing during Docker image build process.
This commit is contained in:
@@ -134,8 +134,19 @@ function SocialButton({ provider, label, icon }: { provider: "github" | "discord
|
||||
|
||||
function AuthentikButton({ label }: { label: string }) {
|
||||
if (!process.env["NEXT_PUBLIC_AUTHENTIK_ENABLED"]) return null;
|
||||
const handleClick = async () => {
|
||||
try {
|
||||
// @ts-expect-error - genericOAuth is available via plugin but not fully typed
|
||||
await signIn.genericOAuth({
|
||||
providerId: "authentik",
|
||||
callbackURL: "/recipes",
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Authentik sign-in failed:", error);
|
||||
}
|
||||
};
|
||||
return (
|
||||
<Button variant="outline" className="w-full gap-2" type="button" onClick={() => (authClient as { signIn: { genericOAuth: (opts: { providerId: string; callbackURL: string }) => Promise<void> } }).signIn.genericOAuth({ providerId: "authentik", callbackURL: "/recipes" })}>
|
||||
<Button variant="outline" className="w-full gap-2" type="button" onClick={handleClick}>
|
||||
<AuthentikIcon />
|
||||
{label}
|
||||
</Button>
|
||||
|
||||
Reference in New Issue
Block a user