sumba 2.38.0 → 2.38.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.
|
@@ -4,7 +4,7 @@ async function autoInc (body, opts) {
|
|
|
4
4
|
const { set, last } = this.app.lib._
|
|
5
5
|
const query = set({}, opts.field, { $regex: new RegExp('^' + body[opts.field]) })
|
|
6
6
|
const sort = set({}, opts.field, -1)
|
|
7
|
-
const options = { noHook: true, skipCache: true,
|
|
7
|
+
const options = { noHook: true, skipCache: true, throwNotFound: false }
|
|
8
8
|
const resp = await this.findOneRecord({ query, sort }, options)
|
|
9
9
|
if (resp) return body[opts.field]
|
|
10
10
|
const rslugs = resp[opts.field].split('-')
|
|
@@ -6,7 +6,7 @@ export default {
|
|
|
6
6
|
|
|
7
7
|
if (socket.handshake) {
|
|
8
8
|
const sessionId = await getSessionId(socket.request.headers.cookie)
|
|
9
|
-
const resp = await this.app.dobo.getModel('WbmpaSession').getRecord(sessionId, { noHook: true,
|
|
9
|
+
const resp = await this.app.dobo.getModel('WbmpaSession').getRecord(sessionId, { noHook: true, throwNotFound: false })
|
|
10
10
|
if (resp) {
|
|
11
11
|
const session = JSON.parse(resp.session) ?? {}
|
|
12
12
|
socket.session = merge({}, session.user, { sessionId, authMethod: 'cookie' })
|