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:
@@ -18,8 +18,8 @@ export default function SignInPage() {
|
|||||||
}, [session, router])
|
}, [session, router])
|
||||||
|
|
||||||
const handleSignIn = async () => {
|
const handleSignIn = async () => {
|
||||||
await signIn.social({
|
await signIn.oauth2({
|
||||||
provider: "authentik",
|
providerId: "authentik",
|
||||||
callbackURL: "/",
|
callbackURL: "/",
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
import { createAuthClient } from "better-auth/react";
|
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;
|
export const { useSession, signIn, signOut } = authClient;
|
||||||
|
|||||||
Reference in New Issue
Block a user