edmaxlabs-core 2.7.1 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +7 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +7 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -151,7 +151,7 @@ var _Authentication = class _Authentication {
|
|
|
151
151
|
this.eUser = void 0;
|
|
152
152
|
this.saveCredentials(null);
|
|
153
153
|
const app = this.app?.getDatabase;
|
|
154
|
-
const data = await app?.collection("
|
|
154
|
+
const data = await app?.collection("authentication").query.where({
|
|
155
155
|
key: "email",
|
|
156
156
|
op: "===",
|
|
157
157
|
value: email
|
|
@@ -159,7 +159,7 @@ var _Authentication = class _Authentication {
|
|
|
159
159
|
if (data.length > 0) {
|
|
160
160
|
throw new Error("Email Already In Use.");
|
|
161
161
|
}
|
|
162
|
-
const userRef = await app?.collection("
|
|
162
|
+
const userRef = await app?.collection("authentication").add({
|
|
163
163
|
email,
|
|
164
164
|
password,
|
|
165
165
|
logged: true,
|
|
@@ -185,7 +185,7 @@ var _Authentication = class _Authentication {
|
|
|
185
185
|
password
|
|
186
186
|
}) => {
|
|
187
187
|
const app = this.app?.getDatabase;
|
|
188
|
-
const data = await app?.collection("
|
|
188
|
+
const data = await app?.collection("authentication").query.where({
|
|
189
189
|
key: "email",
|
|
190
190
|
op: "===",
|
|
191
191
|
value: email
|
|
@@ -202,7 +202,7 @@ var _Authentication = class _Authentication {
|
|
|
202
202
|
throw new Error("User Not Found.");
|
|
203
203
|
}
|
|
204
204
|
const _data = data[0];
|
|
205
|
-
await app?.collection("
|
|
205
|
+
await app?.collection("authentication").doc(_data.id).update({
|
|
206
206
|
logged: true,
|
|
207
207
|
lastLogged: Date.now()
|
|
208
208
|
});
|
|
@@ -215,7 +215,7 @@ var _Authentication = class _Authentication {
|
|
|
215
215
|
throw new Error("No User Signed in");
|
|
216
216
|
}
|
|
217
217
|
const app = this.app?.getDatabase;
|
|
218
|
-
const userRef = await app?.collection("
|
|
218
|
+
const userRef = await app?.collection("authentication").doc(this.eUser.uid).delete();
|
|
219
219
|
if (userRef) {
|
|
220
220
|
throw new Error("Something went wrong try Again.");
|
|
221
221
|
}
|
|
@@ -228,7 +228,7 @@ var _Authentication = class _Authentication {
|
|
|
228
228
|
this.eUser = void 0;
|
|
229
229
|
this.saveCredentials(null);
|
|
230
230
|
if (luid)
|
|
231
|
-
await app?.collection("
|
|
231
|
+
await app?.collection("authentication").doc(luid?.uid).update({
|
|
232
232
|
logged: false,
|
|
233
233
|
lastLogged: Date.now()
|
|
234
234
|
});
|
|
@@ -342,7 +342,7 @@ var _Authentication = class _Authentication {
|
|
|
342
342
|
onSignOut?.();
|
|
343
343
|
return;
|
|
344
344
|
}
|
|
345
|
-
const userRef = this.app?.getDatabase.collection("
|
|
345
|
+
const userRef = this.app?.getDatabase.collection("authentication").doc(creds.uid);
|
|
346
346
|
if (!userRef)
|
|
347
347
|
return;
|
|
348
348
|
userDocUnsubscribe = userRef.onSnapshot(
|