Skip to content

Commit

Permalink
add: auth-module
Browse files Browse the repository at this point in the history
  • Loading branch information
DanilSord committed Mar 11, 2022
1 parent 3278fc5 commit 70d9ead
Showing 1 changed file with 119 additions and 0 deletions.
119 changes: 119 additions & 0 deletions lib/auth-module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
const { Auth } = require('./auth');

module.exports = {
schema: {
register: {
public: true,
description: 'Регистрация',
params: {
required: ['username', 'password'],
properties: {
username: {
type: 'string',
description: 'Имя пользователя'
},
password: {
type: 'string'
}
}
},
result: {
required: ['username', 'role', 'createdTime'],
properties: {
username: {
type: 'string'
},
role: {
type: 'string'
},
createdTime: {
type: 'string'
}
}
},
transport: 'http'
},
login: {
public: true,
params: {
required: ['username', 'password'],
properties: {
username: {
type: 'string'
},
password: {
type: 'string'
}
}
},
result: {
required: ['username', 'role', 'createdTime'],
properties: {
username: {
type: 'string'
},
role: {
type: 'string'
},
createdTime: {
type: 'string'
}
}
},
transport: 'http'
},
logout: {
public: false,
transport: 'http'
},
me: {
public: false,
result: {
required: ['username', 'role', 'createdTime'],
properties: {
username: {
type: 'string'
},
role: {
type: 'string'
},
createdTime: {
type: 'string'
}
}
}
},
changePassword: {
public: false,
params: {
required: ['username', 'oldPassword', 'newPassword'],
properties: {
username: {
type: 'string'
},
oldPassword: {
type: 'string'
},
newPassword: {
type: 'string'
}
}
},
result: {
required: ['username', 'role', 'createdTime'],
properties: {
username: {
type: 'string'
},
role: {
type: 'string'
},
createdTime: {
type: 'string'
}
}
}
}
},
Module: Auth
};

0 comments on commit 70d9ead

Please sign in to comment.