Amit Sharma
Amit Sharma
BABetter Auth
Created by joseph013318 on 2/25/2025 in #help
Pending state not resolving!
It didn't work. It has been asked on the github to share a screen recording of the issue so will record one and share to help them understand. Thanks @joseph013318
9 replies
BABetter Auth
Created by joseph013318 on 2/25/2025 in #help
Pending state not resolving!
@joseph013318 Will try upgrading and then test again.
9 replies
BABetter Auth
Created by saze on 2/25/2025 in #bug-reports
getSession returning null in dev mode
I am facing issue in making the session object available right after signin for nextjs project. I am signing in user using email and password, throught server action with "auth.api.signInEmail", the cookies are set immediately but the session object stays null, I did try both useSession on client component and getSession with headers on server component but no luck. The session object do loads up but only when I do a full refresh. What I am missing here ?
import { createAuthClient } from "better-auth/react";
import { inferAdditionalFields } from "better-auth/client/plugins";
import type { auth } from "./auth";

export const authClient = createAuthClient({
baseURL: process.env.NEXT_PUBLIC_BETTER_AUTH_BASE_URL!,
plugins: [inferAdditionalFields<typeof auth>()],
});

export const { signUp, signIn, signOut, useSession } = authClient;
import { createAuthClient } from "better-auth/react";
import { inferAdditionalFields } from "better-auth/client/plugins";
import type { auth } from "./auth";

export const authClient = createAuthClient({
baseURL: process.env.NEXT_PUBLIC_BETTER_AUTH_BASE_URL!,
plugins: [inferAdditionalFields<typeof auth>()],
});

export const { signUp, signIn, signOut, useSession } = authClient;
6 replies
BABetter Auth
Created by joseph013318 on 2/25/2025 in #help
Pending state not resolving!
I am redirecting to home page after sigin and have a simple logic in client side header that if (session) then display user profile icon but that too not working, only when I do a hard refresh the the session object gets updated.
9 replies
BABetter Auth
Created by joseph013318 on 2/25/2025 in #help
Pending state not resolving!
I am dealing with a similar issue, after signIn the auth cookies is getting set immediately but the useSession stays null.
9 replies