Skip to content

Commit

Permalink
session: update validate paths
Browse files Browse the repository at this point in the history
  • Loading branch information
msimerson committed Feb 25, 2024
1 parent 6334303 commit cb545ae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
5 changes: 1 addition & 4 deletions lib/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ class User {
async create(args) {
// console.log(args)
const u = await this.get({ id: args.id, gid: args.gid })
if (u.length === 1) {
console.log(u)
return u[0].id
}
if (u.length === 1) return u[0].id

if (args.password) {
if (!args.pass_salt) args.pass_salt = this.generateSalt()
Expand Down
8 changes: 4 additions & 4 deletions routes/session.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = (server) => {
path: '/session',
options: {
response: {
schema: validate.user.sessionOut,
schema: validate.session.GET,
},
tags: ['api'],
},
Expand Down Expand Up @@ -40,10 +40,10 @@ module.exports = (server) => {
options: {
auth: { mode: 'try' },
validate: {
payload: validate.user.sessionPOST,
payload: validate.session.POST,
},
response: {
schema: validate.user.sessionOut,
schema: validate.session.GET,
},
tags: ['api'],
},
Expand Down Expand Up @@ -93,7 +93,7 @@ module.exports = (server) => {
},
options: {
response: {
schema: validate.user.sessionOut,
schema: validate.session.GET,
},
tags: ['api'],
},
Expand Down

0 comments on commit cb545ae

Please sign in to comment.