A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
feat: handle emailConfirmed SSE
thecodrrb87ba6259ae8
diff --git a/packages/core/api/index.js b/packages/core/api/index.jsindex 0bf32e1f8..ec571afcc 100644--- a/packages/core/api/index.js+++ b/packages/core/api/index.js@@ -78,6 +78,7 @@ class Database {await this.settings.init();await this.outbox.init();+ await this.user.init();await this.migrations.init();await this.migrations.migrate();@@ -107,6 +108,7 @@ class Database {this.evtSource.onmessage = async (event) => {try {var { type, data } = JSON.parse(event.data);+ console.log(type, data);} catch (e) {console.log("SSE: Unsupported message. Message = ", event.data);return;@@ -127,6 +129,11 @@ class Database {await this.user.logout();EV.publish("user:passwordChanged");break;+ case "emailConfirmed":+ const token = await this.context.read("token");+ await this.user.tokenManager._refreshToken(token);+ EV.publish("user:emailConfirmed");+ break;case "sync":await this.syncer.eventMerge(data);EV.publish("db:refresh");diff --git a/packages/core/utils/http.js b/packages/core/utils/http.jsindex 6d0a02d3c..ad3037516 100644--- a/packages/core/utils/http.js+++ b/packages/core/utils/http.js@@ -19,6 +19,7 @@ post.json = function (url, data, token) {};function transformer(data, json) {+ if (!data) return;if (json) return JSON.stringify(data);else {return Object.entries(data)