shogun-core 3.0.9 → 3.0.10
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.
|
@@ -88142,9 +88142,15 @@ class DataBase {
|
|
|
88142
88142
|
*/
|
|
88143
88143
|
getCurrentUser() {
|
|
88144
88144
|
try {
|
|
88145
|
-
const
|
|
88146
|
-
|
|
88147
|
-
|
|
88145
|
+
const _user = this.gun.user();
|
|
88146
|
+
return _user?.is?.pub
|
|
88147
|
+
? {
|
|
88148
|
+
pub: _user?.is?.pub,
|
|
88149
|
+
epub: _user?.is?.epub,
|
|
88150
|
+
alias: _user?.is?.alias,
|
|
88151
|
+
user: _user,
|
|
88152
|
+
}
|
|
88153
|
+
: null;
|
|
88148
88154
|
}
|
|
88149
88155
|
catch (error) {
|
|
88150
88156
|
console.error("Error getting current user:", error);
|
|
@@ -89206,7 +89212,7 @@ class DataBase {
|
|
|
89206
89212
|
// Save credentials for future sessions
|
|
89207
89213
|
try {
|
|
89208
89214
|
const userInfo = {
|
|
89209
|
-
username,
|
|
89215
|
+
alias: username,
|
|
89210
89216
|
pair: pair ?? null,
|
|
89211
89217
|
userPub: userPub,
|
|
89212
89218
|
};
|
|
@@ -89279,7 +89285,7 @@ class DataBase {
|
|
|
89279
89285
|
saveCredentials(userInfo) {
|
|
89280
89286
|
try {
|
|
89281
89287
|
const sessionInfo = {
|
|
89282
|
-
username: userInfo.
|
|
89288
|
+
username: userInfo.alias,
|
|
89283
89289
|
pair: userInfo.pair,
|
|
89284
89290
|
userPub: userInfo.userPub,
|
|
89285
89291
|
timestamp: Date.now(),
|
|
@@ -89932,7 +89938,7 @@ class SimpleGunAPI {
|
|
|
89932
89938
|
if (user) {
|
|
89933
89939
|
return {
|
|
89934
89940
|
pub: user.pub,
|
|
89935
|
-
username: user.
|
|
89941
|
+
username: user.alias,
|
|
89936
89942
|
};
|
|
89937
89943
|
}
|
|
89938
89944
|
return null;
|