From 74c079524849e559a7b8de6ff7d7a403d2a4119a Mon Sep 17 00:00:00 2001 From: thecashewtrader Date: Mon, 28 Nov 2022 16:57:35 +0530 Subject: [PATCH 1/4] Add a note if user attempts to register with (apparently) an email --- src/components/RegisterPage.vue | 2 ++ src/locales/en.json | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/RegisterPage.vue b/src/components/RegisterPage.vue index 4817a4ac..d55f016b 100644 --- a/src/components/RegisterPage.vue +++ b/src/components/RegisterPage.vue @@ -52,6 +52,8 @@ export default { methods: { register() { if (!this.username || !this.password) return; + if (this.username.includes("@") && !confirm(this.$t("info.register_no_email_note"))) return; + this.fetchJson(this.authApiUrl() + "/register", null, { method: "POST", body: JSON.stringify({ diff --git a/src/locales/en.json b/src/locales/en.json index fab0ced3..09afa88f 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -168,6 +168,7 @@ "page_not_found": "Page not found", "copied": "Copied!", "cannot_copy": "Can't copy!", - "local_storage": "This action requires localStorage, are cookies enabled?" + "local_storage": "This action requires localStorage, are cookies enabled?", + "register_no_email_note": "Piped has detected that you are using an email as username to register. Providing an email is not required to register on Piped. If you still want to continue, press OK." } } From 66913818b44d129df1ee9efdf9ecff77c416103f Mon Sep 17 00:00:00 2001 From: thecashewtrader Date: Mon, 28 Nov 2022 20:36:02 +0530 Subject: [PATCH 2/4] Use regex to check for email on RegisterPage --- src/components/RegisterPage.vue | 4 +++- src/utils/Misc.js | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 src/utils/Misc.js diff --git a/src/components/RegisterPage.vue b/src/components/RegisterPage.vue index d55f016b..ee95ebc6 100644 --- a/src/components/RegisterPage.vue +++ b/src/components/RegisterPage.vue @@ -33,6 +33,8 @@