Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Take 2

Manav Rathibfe8fd83acfb
diff --git a/web/apps/auth/src/services/code.ts b/web/apps/auth/src/services/code.ts
index ff29c58fdd..0acc537f0c 100644
--- a/web/apps/auth/src/services/code.ts
+++ b/web/apps/auth/src/services/code.ts
@@ -69,8 +69,12 @@ const parseType = (url: URL): Code["type"] => {
};
/** Convert the pathname from "/ACME:[email protected]" => "[email protected]" */
-const parseAccount = (url: URL): string =>
- url.pathname.split(":").at(-1).split("/").at(-1);
+const parseAccount = (url: URL): string => {
+ let p = url.pathname;
+ if (p.startsWith("/")) p = p.slice(1);
+ if (p.includes(":")) p = p.split(":").slice(1).join(":");
+ return p;
+};
const _getIssuer = (uriPath: string, uriParams: { get?: any }): string => {
try {