generated from Ethan-Arrowood/harperdb-fastify-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauth.js
33 lines (31 loc) · 706 Bytes
/
auth.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use strict'
async function auth (server, options) {
server.route({
url: '/get-token',
method: 'GET',
handler: async (request, response) => {
options.hdb.request({
operation: {
operation: 'create_authentication_tokens',
username: request.query.username,
password: request.query.password
},
response
})
}
})
server.route({
url: '/refresh-token',
method: 'GET',
handler: async (request, response) => {
options.hdb.request({
operation: {
operation: 'refresh_operation_token'
},
response
})
}
})
}
module.exports = auth
module.exports.autoPrefix = '/auth'