Also include same workaround as mobile app
This commit is contained in:
parent
2ce9212457
commit
eaf8b9cebc
1 changed files with 13 additions and 0 deletions
|
@ -49,6 +49,19 @@ export interface Code {
|
|||
* See also `auth/test/models/code_test.dart`.
|
||||
*/
|
||||
export const codeFromURIString = (id: string, uriString: string): Code => {
|
||||
try {
|
||||
return _codeFromURIString(id, uriString);
|
||||
} catch (e) {
|
||||
// We might have legacy encodings of account names that contain a "#",
|
||||
// which causes the rest of the URL to be treated as a fragment, and
|
||||
// ignored. See if this was potentially such a case, otherwise rethrow.
|
||||
if (uriString.includes("#"))
|
||||
return _codeFromURIString(id, uriString.replaceAll("#", "%23"));
|
||||
throw e;
|
||||
}
|
||||
};
|
||||
|
||||
const _codeFromURIString = (id: string, uriString: string): Code => {
|
||||
const url = new URL(uriString);
|
||||
|
||||
return {
|
||||
|
|
Loading…
Add table
Reference in a new issue