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!
2 Replies
Kabeer
KabeerOP4mo ago
im on v1.1.2 The totpURI generated in versions before v1.1.0 works v1.0.22 -> Works
bekacru
bekacru4mo ago
this should be fixed on v1.1.3-beta.6

Did you find this page helpful?