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.mjs
CHANGED
|
@@ -119,7 +119,7 @@ var _Authentication = class _Authentication {
|
|
|
119
119
|
this.eUser = void 0;
|
|
120
120
|
this.saveCredentials(null);
|
|
121
121
|
const app = this.app?.getDatabase;
|
|
122
|
-
const data = await app?.collection("
|
|
122
|
+
const data = await app?.collection("authentication").query.where({
|
|
123
123
|
key: "email",
|
|
124
124
|
op: "===",
|
|
125
125
|
value: email
|
|
@@ -127,7 +127,7 @@ var _Authentication = class _Authentication {
|
|
|
127
127
|
if (data.length > 0) {
|
|
128
128
|
throw new Error("Email Already In Use.");
|
|
129
129
|
}
|
|
130
|
-
const userRef = await app?.collection("
|
|
130
|
+
const userRef = await app?.collection("authentication").add({
|
|
131
131
|
email,
|
|
132
132
|
password,
|
|
133
133
|
logged: true,
|
|
@@ -153,7 +153,7 @@ var _Authentication = class _Authentication {
|
|
|
153
153
|
password
|
|
154
154
|
}) => {
|
|
155
155
|
const app = this.app?.getDatabase;
|
|
156
|
-
const data = await app?.collection("
|
|
156
|
+
const data = await app?.collection("authentication").query.where({
|
|
157
157
|
key: "email",
|
|
158
158
|
op: "===",
|
|
159
159
|
value: email
|
|
@@ -170,7 +170,7 @@ var _Authentication = class _Authentication {
|
|
|
170
170
|
throw new Error("User Not Found.");
|
|
171
171
|
}
|
|
172
172
|
const _data = data[0];
|
|
173
|
-
await app?.collection("
|
|
173
|
+
await app?.collection("authentication").doc(_data.id).update({
|
|
174
174
|
logged: true,
|
|
175
175
|
lastLogged: Date.now()
|
|
176
176
|
});
|
|
@@ -183,7 +183,7 @@ var _Authentication = class _Authentication {
|
|
|
183
183
|
throw new Error("No User Signed in");
|
|
184
184
|
}
|
|
185
185
|
const app = this.app?.getDatabase;
|
|
186
|
-
const userRef = await app?.collection("
|
|
186
|
+
const userRef = await app?.collection("authentication").doc(this.eUser.uid).delete();
|
|
187
187
|
if (userRef) {
|
|
188
188
|
throw new Error("Something went wrong try Again.");
|
|
189
189
|
}
|
|
@@ -196,7 +196,7 @@ var _Authentication = class _Authentication {
|
|
|
196
196
|
this.eUser = void 0;
|
|
197
197
|
this.saveCredentials(null);
|
|
198
198
|
if (luid)
|
|
199
|
-
await app?.collection("
|
|
199
|
+
await app?.collection("authentication").doc(luid?.uid).update({
|
|
200
200
|
logged: false,
|
|
201
201
|
lastLogged: Date.now()
|
|
202
202
|
});
|
|
@@ -310,7 +310,7 @@ var _Authentication = class _Authentication {
|
|
|
310
310
|
onSignOut?.();
|
|
311
311
|
return;
|
|
312
312
|
}
|
|
313
|
-
const userRef = this.app?.getDatabase.collection("
|
|
313
|
+
const userRef = this.app?.getDatabase.collection("authentication").doc(creds.uid);
|
|
314
314
|
if (!userRef)
|
|
315
315
|
return;
|
|
316
316
|
userDocUnsubscribe = userRef.onSnapshot(
|