FormatException (FormatException: Missing padding character (at character 280) on example project sign up
Closed this issue · 3 comments
ryanhz commented
FormatException (FormatException: Missing padding character (at character 280)
...Tmk0c0EiLCJhbmRyb2lkUGFja2FnZU5hbWUiOiJjb20uY29yYmFkby5wYXNza2V5cy5wdWIifQ=
^
)
It turns out that the raw is not correctly base64 padded, replace this line:
final raw = '${response.clientDataJSON}=';
with
final raw = padBase64(response.clientDataJSON);
and add function:
String padBase64(String rawBase64) {
return (rawBase64.length % 4 > 0)
? rawBase64 += List.filled(4 - (rawBase64.length % 4), "=").join("")
: rawBase64;
}
should fix the issue.
stensonb commented
just ran into this (same?) issue (https://passkeys.flutter.corbado.io/#/sign-up):
thiwa8 commented