π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Restrict auth issuer period cleanup
Manav Rathi9baa351c6db3
diff --git a/web/apps/auth/src/services/code.ts b/web/apps/auth/src/services/code.tsindex c974fda9f1..d4f97c7b57 100644--- a/web/apps/auth/src/services/code.ts+++ b/web/apps/auth/src/services/code.ts@@ -193,9 +193,12 @@ const parseIssuer = (url: URL, path: string): string => {let issuer = url.searchParams.get("issuer");if (issuer) {// This is to handle bug in old versions of Ente Auth app.- const periodIndex = issuer.indexOf("period=");- if (periodIndex >= 0) {- issuer = issuer.substring(0, periodIndex);+ const periodSuffixIndex = issuer.search(/&?period=\d+$/);+ if (+ periodSuffixIndex > 0 &&+ !/\s/.test(issuer.charAt(periodSuffixIndex - 1))+ ) {+ issuer = issuer.substring(0, periodSuffixIndex);}if (issuer.endsWith("period")) {issuer = issuer.substring(0, issuer.length - 6);