diff --git a/components/app/Header.vue b/components/app/Header.vue index af6b9b4df..67d6985b9 100644 --- a/components/app/Header.vue +++ b/components/app/Header.vue @@ -73,7 +73,7 @@ login - + @@ -160,6 +160,7 @@ /> + @@ -178,6 +179,7 @@ export default { showExtensions: false, showShortcuts: false, showSupport: false, + showEmail: false, navigatorShare: navigator.share, fb, } diff --git a/components/firebase/Email.vue b/components/firebase/Email.vue new file mode 100644 index 000000000..5b1bbde75 --- /dev/null +++ b/components/firebase/Email.vue @@ -0,0 +1,136 @@ + + + + + {{ $t("login_with") }} {{ $t("email") }} + + + close + + + + + + E-mail + + + + + + verified + + + {{ $t("we_sent_magic_link") }} + + + {{ $t("we_sent_magic_link_description", { email: form.email }) }} + + {{ $t("check_your_inbox") }} + + + + + + + + {{ $t("loading") }} + + + {{ $t("send_magic_link") }} + + + + + + + + diff --git a/components/firebase/Login.vue b/components/firebase/Login.vue index 0ecce0503..3491a85d2 100644 --- a/components/firebase/Login.vue +++ b/components/firebase/Login.vue @@ -30,6 +30,12 @@ GitHub + + + mail + {{ $t("email") }} + + diff --git a/components/http/Notes.vue b/components/http/Notes.vue index 483a71868..c325a9e34 100644 --- a/components/http/Notes.vue +++ b/components/http/Notes.vue @@ -6,8 +6,9 @@ {{ $t("login_first") }} - + + @@ -18,6 +19,7 @@ export default { data() { return { fb, + showEmail: false, } }, } diff --git a/components/smart/Modal.vue b/components/smart/Modal.vue index c31966f98..b7de431f8 100644 --- a/components/smart/Modal.vue +++ b/components/smart/Modal.vue @@ -44,7 +44,7 @@ export default { @apply ease-in-out; @apply duration-150; - background-color: rgba(255, 255, 255, 0.02); + background-color: rgba(0, 0, 0, 0.32); } .modal-wrapper { @@ -66,6 +66,8 @@ export default { @apply bg-bgColor; @apply rounded-lg; @apply shadow-2xl; + @apply border; + @apply border-ttColor; max-height: calc(100vh - 128px); max-width: 640px; diff --git a/components/teams/index.vue b/components/teams/index.vue index 5c422f5c3..327bea09b 100644 --- a/components/teams/index.vue +++ b/components/teams/index.vue @@ -12,7 +12,7 @@ {{ $t("login_with") }} - + @@ -50,6 +50,7 @@ + @@ -67,6 +68,7 @@ export default { me: {}, myTeams: [], fb, + showEmail: false, } }, apollo: { diff --git a/helpers/fb.js b/helpers/fb.js index 450ee2f66..18cf0b139 100644 --- a/helpers/fb.js +++ b/helpers/fb.js @@ -327,6 +327,20 @@ export class FirebaseInstance { return await this.app.auth().fetchSignInMethodsForEmail(email) } + async signInWithEmail(email, actionCodeSettings) { + return await this.app + .auth() + .sendSignInLinkToEmail(email, actionCodeSettings) + } + + async isSignInWithEmailLink(url) { + return await this.app.auth().isSignInWithEmailLink(url) + } + + async signInWithEmailLink(email, url) { + return await this.app.auth().signInWithEmailLink(email, url) + } + async signOutUser() { if (!this.currentUser) throw new Error("No user has logged in") diff --git a/lang/en-US.json b/lang/en-US.json index dd17f01ae..34bac43bd 100644 --- a/lang/en-US.json +++ b/lang/en-US.json @@ -332,5 +332,10 @@ "role_updated": "User role(s) updated successfully", "user_removed": "User removed successfully", "import_from_my_collections": "Import from My Collections", - "export_as_json": "Export as JSON" + "export_as_json": "Export as JSON", + "send_magic_link": "Send a magic link to sign in", + "check_your_inbox": "Check your inbox.", + "you_can_dismiss_this_modal": "You can dismiss this ", + "we_sent_magic_link": "We sent you a magic link!", + "we_sent_magic_link_description": "We sent an email to {email}. It contains a magic link that’ll log you in." } diff --git a/pages/enter.vue b/pages/enter.vue new file mode 100644 index 000000000..d3013ce85 --- /dev/null +++ b/pages/enter.vue @@ -0,0 +1,42 @@ + + + {{ $t("loading") }} + {{ $t("waiting_for_connection") }} + {{ error }} + + + + diff --git a/pages/index.vue b/pages/index.vue index 2059ca4ca..4b43a33cb 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -77,8 +77,8 @@ - {{ $t("token_req_name") }} - + {{ $t("token_req_name") }} + diff --git a/pages/settings.vue b/pages/settings.vue index e65debbf3..93128d1fc 100644 --- a/pages/settings.vue +++ b/pages/settings.vue @@ -68,7 +68,7 @@ {{ $t("login_with") }} - + @@ -207,6 +207,7 @@ + @@ -244,6 +245,8 @@ export default Vue.extend({ EXTENSIONS_ENABLED: true, PROXY_ENABLED: true, + + showEmail: false, } }, subscriptions() {
+ {{ $t("we_sent_magic_link_description", { email: form.email }) }} +
{{ $t("check_your_inbox") }}
{{ $t("login_first") }}
- +
{{ error }}