yasserconnect
yasserconnect
Explore posts from servers
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
import {
adminClient,
organizationClient,
passkeyClient,
twoFactorClient,
usernameClient,
} from 'better-auth/client/plugins';
import { createAuthClient } from 'better-auth/react';
import { toast } from 'sonner';
import { appUrl } from '../appConfig';

export const authClient = createAuthClient({
baseURL: appUrl,
plugins: [
organizationClient(),
twoFactorClient({
onTwoFactorRedirect() {
window.location.href = '/two-factor';
},
}),
passkeyClient(),
adminClient(),
usernameClient(),
],
fetchOptions: {
onError(e) {
if (e.error.status === 429) {
toast.error('wait a moment before trying again');
}
},
},
});

export const {
signUp,
signIn,
signOut,
useSession,
organization,
useListOrganizations,
useActiveOrganization,
} = authClient;
import {
adminClient,
organizationClient,
passkeyClient,
twoFactorClient,
usernameClient,
} from 'better-auth/client/plugins';
import { createAuthClient } from 'better-auth/react';
import { toast } from 'sonner';
import { appUrl } from '../appConfig';

export const authClient = createAuthClient({
baseURL: appUrl,
plugins: [
organizationClient(),
twoFactorClient({
onTwoFactorRedirect() {
window.location.href = '/two-factor';
},
}),
passkeyClient(),
adminClient(),
usernameClient(),
],
fetchOptions: {
onError(e) {
if (e.error.status === 429) {
toast.error('wait a moment before trying again');
}
},
},
});

export const {
signUp,
signIn,
signOut,
useSession,
organization,
useListOrganizations,
useActiveOrganization,
} = authClient;
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
still the problem exist
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
Ok i will try relative path
await signIn.social({
provider: 'google',
callbackURL: '/home',
});
await signIn.social({
provider: 'google',
callbackURL: '/home',
});
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
Yes I’m using NextJs
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
and the auth config:
socialProviders: {
google: {
clientId: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID as string,
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
redirectURI: `${appUrl}/api/auth/callback/google`,
},
},
socialProviders: {
google: {
clientId: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID as string,
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
redirectURI: `${appUrl}/api/auth/callback/google`,
},
},
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
<Button
type="button"
variant="outline"
isLoading={gloading}
icon={<Icons.google className="ml-1" />}
onClick={async (e) => {
e.preventDefault();
setgLoading(true);
await signIn.social({
provider: 'google',
callbackURL: homeUrl,
});
setgLoading(false);
}}>
sign in with google
</Button>
<Button
type="button"
variant="outline"
isLoading={gloading}
icon={<Icons.google className="ml-1" />}
onClick={async (e) => {
e.preventDefault();
setgLoading(true);
await signIn.social({
provider: 'google',
callbackURL: homeUrl,
});
setgLoading(false);
}}>
sign in with google
</Button>
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
you mean google sign-in?
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
this through the error:
if (!data) {
c.context.logger.error("State Mismatch. Verification not found", {
state,
});
throw c.redirect(
`${c.context.baseURL}/error?error=please_restart_the_process`,
);
}
if (!data) {
c.context.logger.error("State Mismatch. Verification not found", {
state,
});
throw c.redirect(
`${c.context.baseURL}/error?error=please_restart_the_process`,
);
}
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
[2m2025-04-13T16:40:22.249Z ERROR [Better Auth]: State Mismatch. Verification not found { state: 'JlasEIZm4cGvSqqeRulcFT9hnksNhNM-' }
[2m2025-04-13T16:40:22.249Z ERROR [Better Auth]: State Mismatch. Verification not found { state: 'JlasEIZm4cGvSqqeRulcFT9hnksNhNM-' }
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
@KiNFiSH @bekacru can you check this?
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
No description
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
No description
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
No description
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
yes still on v1.2.6 too!
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
Until we find the actual problem and fix it, I’ve customized the error page to redirect to the homepage as a temporary solution.
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
no logs just code error = "please_restart_the_process"
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
this what i used in production Google dev console Authorized redirect URIs: https://my-site.com/api/auth/callback/google ..... BETTER_AUTH_URL= https://my-site.com baseURL= https://my-site.com is this correct? ❓
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
i did that in google dev console, both for local and production. but the wired error still exist
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
could you look at onAPIError config, maybe it cause the error 'please_restart_the_process' after sign-in via google.
50 replies
BABetter Auth
Created by yasserconnect on 4/12/2025 in #bug-reports
Google Sign-In throws Error in Production
i added BETTER_AUTH_URL env and baseURL in betterAuth config but still the problem exist!!
50 replies