fix(auth): use correct sign-in method for genericOAuth

Add genericOAuthClient plugin to auth client and change sign-in
call from signIn.social() to signIn.oauth2() with correct
providerId parameter.
This commit is contained in:
old4ever committed 2026-04-06 23:20:39 -04:00
1 parent c3026c8262
commit bcd488e2d3
2 files changed
+6 -3

No files matched your search

+2 -2
View File
@@ -18,8 +18,8 @@ export default function SignInPage() {
}, [session, router])
const handleSignIn = async () => {
await signIn.social({
provider: "authentik",
await signIn.oauth2({
providerId: "authentik",
callbackURL: "/",
})
}
+4 -1
View File
@@ -1,5 +1,8 @@
import { createAuthClient } from "better-auth/react";
import { genericOAuthClient } from "better-auth/client/plugins";
export const authClient = createAuthClient();
export const authClient = createAuthClient({
plugins: [genericOAuthClient()],
});
export const { useSession, signIn, signOut } = authClient;