fix(auth): encode ',' as %2C for correctly importing later on
This commit is contained in:
parent
36685f4827
commit
ea72300fe5
3 changed files with 3 additions and 11 deletions
|
@ -257,15 +257,6 @@ class Code {
|
|||
throw UnsupportedError("Unsupported format with host ${uri.host}");
|
||||
}
|
||||
|
||||
String get rawDataWithoutDisplay {
|
||||
return jsonEncode(
|
||||
Uri.parse(
|
||||
"$rawData&codeDisplay="
|
||||
"${jsonEncode(display.toJson())}",
|
||||
).toString(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
if (identical(this, other)) return true;
|
||||
|
|
|
@ -56,7 +56,8 @@ class CodeDisplay {
|
|||
|
||||
static CodeDisplay? fromUri(Uri uri) {
|
||||
if (!uri.queryParameters.containsKey("codeDisplay")) return null;
|
||||
final String codeDisplay = uri.queryParameters['codeDisplay']!;
|
||||
final String codeDisplay =
|
||||
uri.queryParameters['codeDisplay']!.replaceAll('%2C', ',');
|
||||
final decodedDisplay = jsonDecode(codeDisplay);
|
||||
|
||||
return CodeDisplay.fromJson(decodedDisplay);
|
||||
|
|
|
@ -175,7 +175,7 @@ Future<String> _getAuthDataForExport() async {
|
|||
String data = "";
|
||||
for (final code in allCodes) {
|
||||
if (code.hasError) continue;
|
||||
data += "${code.rawDataWithoutDisplay}\n";
|
||||
data += "${code.rawData.replaceAll(',', '%2C')}\n";
|
||||
}
|
||||
|
||||
return data;
|
||||
|
|
Loading…
Add table
Reference in a new issue