Not requiring captcha for social signins

Is there any way to just not require it for social signins?
12 Replies
aa55h
aa55hOP3w ago
bump?
bekacru
bekacru3w ago
are you using the captcha plugin? if so you can pass endpoints
aa55h
aa55hOP3w ago
yes well, but the social sign in button is on the same page as the email signin
bekacru
bekacru3w ago
but that's on the client. The server only requires it for paths specefied in the plugin config . For exmaple, for email and password only you can pass endpoints: ["/sign-in/email"]
aa55h
aa55hOP2w ago
oh so its for api endpoints and not actual pages? or do i not understand
aa55h
aa55hOP2w ago
well it still forces me to complete the captcha after clicking on sign in with google
No description
Lionel
Lionel2w ago
Same problem for me
bekacru
bekacru2w ago
Could you send me your auth config?
Lionel
Lionel2w ago
https://github.com/better-auth/better-auth/pull/2065 @bekacru here is my config import { betterAuth } from 'better-auth' import Database from 'better-sqlite3' import { twoFactor, emailOTP, captcha } from 'better-auth/plugins' export const auth = betterAuth({ advanced: { cookiePrefix: 'bn', }, database: new Database('./sqlite.db'), emailAndPassword: { enabled: true, }, emailVerification: { autoSignInAfterVerification: true, sendOnSignUp: true, requireEmailVerification: true, }, socialProviders: { google: { clientId: process.env.BETTER_AUTH_GOOGLE_ID as string, clientSecret: process.env.BETTER_AUTH_GOOGLE_SECRET as string, }, apple: { clientId: process.env.BETTER_AUTH_APPLE_ID as string, clientSecret: process.env.BETTER_AUTH_APPLE_SECRET as string, appBundleIdentifier: process.env.BETTER_AUTH_APPLE_APP_BUNDLE_IDENTIFIER, }, facebook: { clientId: process.env.BETTER_AUTH_FACEBOOK_ID as string, clientSecret: process.env.BETTER_AUTH_FACEBOOK_SECRET as string, }, tiktok: { clientId: process.env.BETTER_AUTH_TIKTOK_ID as string, clientSecret: process.env.BETTER_AUTH_TIKTOK_SECRET as string, clientKey: process.env.BETTER_AUTH_TIKTOK_CLIENT_KEY, }, }, plugins: [ twoFactor(), emailOTP({ async sendVerificationOTP() {}, }), captcha({ provider: 'cloudflare-turnstile', secretKey: process.env.TURNSTILE_SECRET_KEY!, endpoints: [], }), ], })
aa55h
aa55hOP5d ago
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
schema: {
user,
session,
account,
verification,
},
}),
onAPIError: {
throw: true,
errorURL: "/error",
},
databaseHooks: {
session: {
create: {
after: async (session, context) => {
logger.info(`User ${session.userId} signed in`);
},
},
},
user: {
create: {
after: async (user, context) => {
logger.info(`User ${user.id} signed up`);
},
},
},
},
plugins: [
nextCookies(),
captcha({
provider: "cloudflare-turnstile",
secretKey: process.env.CAPTCHA_SECRET_KEY as string,
endpoints: ["/sign-in/email", "/sign-up"]
}),
],
emailAndPassword: {
enabled: true,
minPasswordLength: 8,
maxPasswordLength: 40,
},
socialProviders: {
github: {
enabled: true,
clientId: process.env.GITHUB_CLIENT_ID as string,
clientSecret: process.env.GITHUB_CLIENT_SECRET as string,
},
google: {
enabled: true,
clientId: process.env.GOOGLE_CLIENT_ID as string,
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
},
},
});
export const auth = betterAuth({
database: drizzleAdapter(db, {
provider: "pg",
schema: {
user,
session,
account,
verification,
},
}),
onAPIError: {
throw: true,
errorURL: "/error",
},
databaseHooks: {
session: {
create: {
after: async (session, context) => {
logger.info(`User ${session.userId} signed in`);
},
},
},
user: {
create: {
after: async (user, context) => {
logger.info(`User ${user.id} signed up`);
},
},
},
},
plugins: [
nextCookies(),
captcha({
provider: "cloudflare-turnstile",
secretKey: process.env.CAPTCHA_SECRET_KEY as string,
endpoints: ["/sign-in/email", "/sign-up"]
}),
],
emailAndPassword: {
enabled: true,
minPasswordLength: 8,
maxPasswordLength: 40,
},
socialProviders: {
github: {
enabled: true,
clientId: process.env.GITHUB_CLIENT_ID as string,
clientSecret: process.env.GITHUB_CLIENT_SECRET as string,
},
google: {
enabled: true,
clientId: process.env.GOOGLE_CLIENT_ID as string,
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
},
},
});
this is mine @Lionel if you manage to find a solution, i will gladly take it
Lionel
Lionel5d ago
i have already created a pull request that solve the issue. We need better-auth team to check it https://github.com/better-auth/better-auth/pull/2065 @bekacru  @admin need help please
aa55h
aa55hOP5d ago
Okay this is great

Did you find this page helpful?