TOTP URI Error After getting scanned by Google Authenticator

server config
 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" />

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!
Was this page helpful?