sumba 1.0.1 → 1.0.3

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/bajo/config.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "multiSite": false,
3
3
  "waibu": {
4
- "title": "Site Network",
5
- "prefix": "network"
4
+ "title": "User Manager",
5
+ "prefix": "site"
6
6
  },
7
7
  "waibuMpa": {
8
8
  "home": "sumba:/my-stuff/profile",
@@ -1,9 +1,9 @@
1
- async function doboSumbaUserBeforeRecordUpdate (body, options) {
1
+ async function doboSumbaUserAfterRecordValidation (body, options) {
2
2
  const { isBcrypt, isMd5, hash } = this.app.bajoExtra
3
3
  const { has } = this.app.bajo.lib._
4
4
 
5
5
  if (has(body, 'password') && !isBcrypt(body.password)) body.password = await hash(body.password, 'bcrypt')
6
- if (has(body, 'token') && !isMd5(body.token)) body.token = await hash(body.token)
6
+ if (has(body, 'token') && !isMd5(body.token)) body.token = await hash(body.password)
7
7
  }
8
8
 
9
- export default doboSumbaUserBeforeRecordUpdate
9
+ export default doboSumbaUserAfterRecordValidation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sumba",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "description": "Bajo Framework's Biz Suite",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -2,7 +2,7 @@ const hidden = []
2
2
  const model = 'SumbaSite'
3
3
 
4
4
  async function get ({ ctx }) {
5
- const { recordGet } = this.app.waibu
5
+ const { recordGet } = this.app.waibuDb
6
6
  const { docSchemaModel } = this.app.waibuRestApi
7
7
 
8
8
  const schema = await docSchemaModel({ model, method: 'get', ctx, options: { hidden, noId: true } })
@@ -2,7 +2,7 @@ const model = 'SumbaUser'
2
2
  const hidden = ['password', 'token', 'siteId']
3
3
 
4
4
  async function get ({ ctx }) {
5
- const { recordGet } = this.app.waibu
5
+ const { recordGet } = this.app.waibuDb
6
6
  const { docSchemaModel } = this.app.waibuRestApi
7
7
  const schema = await docSchemaModel({ model, method: 'get', ctx, options: { hidden, noId: true } })
8
8
  const handler = async function get (req, reply, options) {
@@ -2,7 +2,7 @@ const model = 'SumbaUser'
2
2
  const hidden = ['password', 'token', 'siteId']
3
3
 
4
4
  async function get ({ ctx }) {
5
- const { recordUpdate } = this.app.waibu
5
+ const { recordUpdate } = this.app.waibuDb
6
6
  const { omit } = this.app.bajo.lib._
7
7
 
8
8
  const { docSchemaModel } = this.app.waibuRestApi
@@ -1,4 +1,4 @@
1
- import { data, body } from '../../../../lib/token-schema.js'
1
+ import { data, body } from '../../../../../lib/token-schema.js'
2
2
 
3
3
  async function create () {
4
4
  const schema = {
@@ -1,4 +1,4 @@
1
- import { data } from '../../../lib/token-schema.js'
1
+ import { data } from '../../../../lib/token-schema.js'
2
2
 
3
3
  async function get ({ ctx }) {
4
4
  const schema = {