sumba 2.22.0 → 2.22.1
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/extend/bajo/hook/dobo.sumba-user@after-update-record.js +2 -4
- package/extend/dobo/model/user.js +2 -1
- package/extend/waibuRestApi/route/your-stuff/profile/get.js +1 -1
- package/index.js +2 -2
- package/lib/collect.js +1 -1
- package/lib/util.js +2 -3
- package/package.json +1 -1
- package/wiki/CHANGES.md +4 -0
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
export async function clearCache (id, result) {
|
|
2
2
|
if (!this.app.bajoCache) return
|
|
3
|
-
const { hash } = this.app.bajoExtra
|
|
4
3
|
const { clear } = this.app.bajoCache ?? {}
|
|
5
|
-
const { get
|
|
6
|
-
|
|
7
|
-
if (!isEmpty(token)) token = await hash(token)
|
|
4
|
+
const { get } = this.app.lib._
|
|
5
|
+
const token = get(result, 'data.token', get(result, 'oldData.token', ''))
|
|
8
6
|
await clear({ key: `dobo|SumbaUser|getUserById|${id}` })
|
|
9
7
|
await clear({ key: `dobo|SumbaUser|getUserByToken|${token}` })
|
|
10
8
|
}
|
|
@@ -28,6 +28,7 @@ async function user () {
|
|
|
28
28
|
maxLength: 100,
|
|
29
29
|
virtual: true,
|
|
30
30
|
getValue: async function (val, rec) {
|
|
31
|
+
if (!rec.salt) return
|
|
31
32
|
return await this.plugin.hash(rec.salt)
|
|
32
33
|
}
|
|
33
34
|
}, {
|
|
@@ -63,7 +64,7 @@ async function user () {
|
|
|
63
64
|
fields: ['email', 'siteId'],
|
|
64
65
|
type: 'unique'
|
|
65
66
|
}],
|
|
66
|
-
hidden: ['password'
|
|
67
|
+
hidden: ['password'],
|
|
67
68
|
features: [
|
|
68
69
|
'sumba:address',
|
|
69
70
|
'sumba:social',
|
package/index.js
CHANGED
|
@@ -173,8 +173,8 @@ async function factory (pkgName) {
|
|
|
173
173
|
start = async () => {
|
|
174
174
|
const { getModel } = this.app.dobo
|
|
175
175
|
if (this.config.interSiteAdmins.length === 0) {
|
|
176
|
-
const site = await getModel('SumbaSite').findOneRecord({ query: { alias: 'default' } }, {
|
|
177
|
-
const user = await getModel('SumbaUser').findOneRecord({ query: { username: 'admin', siteId: site.id } }, {
|
|
176
|
+
const site = await getModel('SumbaSite').findOneRecord({ query: { alias: 'default' } }, { noMagic: true })
|
|
177
|
+
const user = await getModel('SumbaUser').findOneRecord({ query: { username: 'admin', siteId: site.id } }, { noMagic: true })
|
|
178
178
|
this.config.interSiteAdmins.push(user.id)
|
|
179
179
|
}
|
|
180
180
|
}
|
package/lib/collect.js
CHANGED
|
@@ -48,5 +48,5 @@ export async function collectTeam () {
|
|
|
48
48
|
await eachPlugins(async function ({ file, dir }) {
|
|
49
49
|
const { ns } = this
|
|
50
50
|
await collect.call(me, { type: 'team', container: 'Routes', handler, file, ns, dir })
|
|
51
|
-
}, { glob: 'route/team.*', prefix: this.ns })
|
|
51
|
+
}, { glob: 'route-guard/team.*', prefix: this.ns })
|
|
52
52
|
}
|
package/lib/util.js
CHANGED
|
@@ -111,10 +111,9 @@ export async function checkUserId (req, reply, source) {
|
|
|
111
111
|
const userId = get(req, 'session.userId')
|
|
112
112
|
|
|
113
113
|
const setUser = async () => {
|
|
114
|
-
|
|
115
|
-
if (!id) return
|
|
114
|
+
if (!userId) return
|
|
116
115
|
try {
|
|
117
|
-
const user = await this.getUserById(
|
|
116
|
+
const user = await this.getUserById(userId, req)
|
|
118
117
|
if (user) req.user = user
|
|
119
118
|
else req.session.userId = null
|
|
120
119
|
} catch (err) {
|
package/package.json
CHANGED
package/wiki/CHANGES.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## 2026-04-25
|
|
4
4
|
|
|
5
|
+
- [2.21.1] Bug fix on team routes collections
|
|
6
|
+
|
|
7
|
+
## 2026-04-25
|
|
8
|
+
|
|
5
9
|
- [2.21.0] Change options to format value using the new key set by dobo
|
|
6
10
|
- [2.21.0] Remove ```options.retainOriginalValue``` since it is not needed anymore
|
|
7
11
|
- [2.21.0] Remove ```property.formatValue``` from all properties
|