Kabeer
Kabeer
BABetter Auth
Created by Kabeer on 3/22/2025 in #help
Wierd behaviour, isPending from useSession not triggering
const { data, isPending } = authClient.useSession();
console.log(isPending)

const { data, isPending } = authClient.useSession();
console.log(isPending)

Im using nextJS 15.2 isPending is always true (sometimes) , it doesn't change to false even after network request is done
5 replies
BABetter Auth
Created by Kabeer on 1/25/2025 in #bug-reports
Failed to get session, when remember me is checked
No description
2 replies
BABetter Auth
Created by Kabeer on 1/11/2025 in #bug-reports
Anonymous user account getting deleted on calling /get-session
Basically Anonymous user accounts are getting deleted after calling /get-session 2 or 3 times (have to set disableDeleteAnonymousUser to true for it to not delete). Also onLinkAccount is getting triggered when no account linking have taken place (only api call is /get-session) My auth config
anonymous({
emailDomainName: "example.com",
onLinkAccount: async ({ anonymousUser, newUser }) => {
console.log("anonymousUser", anonymousUser);
console.log("newUser", newUser);
// perform actions like moving the cart items from anonymous user to the new user
},
}),

session: {
expiresIn: 60 * 60 * 24 * 30,
updateAge: 0,
cookieCache: {
enabled: false,
},
},
anonymous({
emailDomainName: "example.com",
onLinkAccount: async ({ anonymousUser, newUser }) => {
console.log("anonymousUser", anonymousUser);
console.log("newUser", newUser);
// perform actions like moving the cart items from anonymous user to the new user
},
}),

session: {
expiresIn: 60 * 60 * 24 * 30,
updateAge: 0,
cookieCache: {
enabled: false,
},
},
5 replies
BABetter Auth
Created by Kabeer on 12/23/2024 in #help
TOTP URI Error After getting scanned by Google Authenticator
server config
plugins: [
username(),
admin(),
twoFactor({
issuer: "example.com",
}),
]
plugins: [
username(),
admin(),
twoFactor({
issuer: "example.com",
}),
]
mfa setup func
import QRCode from "react-qr-code";

const setupMFA = async (data: IPasswordSchema) => {
toast.loading("Generating MFA QR code, please wait...", {
id: "mfa-setup",
});
const res = await authClient.twoFactor.enable({
password: data.password,
});
if (res.error) {
toast.error(res.error.message, {
id: "mfa-setup",
});
setMfaData(null);
return;
}

setMfaData(res.data);

toast.success("QR code generated successfully", {
id: "mfa-setup",
});
};


<QRCode value={totpURI} className="w-full" />
import QRCode from "react-qr-code";

const setupMFA = async (data: IPasswordSchema) => {
toast.loading("Generating MFA QR code, please wait...", {
id: "mfa-setup",
});
const res = await authClient.twoFactor.enable({
password: data.password,
});
if (res.error) {
toast.error(res.error.message, {
id: "mfa-setup",
});
setMfaData(null);
return;
}

setMfaData(res.data);

toast.success("QR code generated successfully", {
id: "mfa-setup",
});
};


<QRCode value={totpURI} className="w-full" />
Generated TOTP URI otpauth://totp?secret=mYRiLalafW4Ya04foIhsXX_BGLV8Ccsn&issuer=example.com&account=test%40gmail.com&digits=6&period=30 Google Authenticator say Error : Cannot interpret OR code Also tried with Ente Auth, It gets scanned but in place of OTP, there is just Error. Not sure if im doing something wrong . Any help ? Thanks!
4 replies