Patched a refresh issue

This commit is contained in:
2021-08-09 20:23:05 +10:00
parent 4ec55bed10
commit c1155909be
4 changed files with 9 additions and 9 deletions
+2 -3
View File
@@ -1,15 +1,14 @@
{
"name": "auth-server",
"version": "1.0.0",
"version": "1.4.2",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "1.0.0",
"version": "1.4.2",
"license": "ISC",
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"dotenv": "^8.6.0",
"express": "^4.17.1",
+1 -2
View File
@@ -1,6 +1,6 @@
{
"name": "auth-server",
"version": "1.4.1",
"version": "1.4.2",
"description": "An API centric auth server. Uses Sequelize and mariaDB by default.",
"main": "server/server.js",
"scripts": {
@@ -20,7 +20,6 @@
"homepage": "https://github.com/krgamestudios/auth-server#readme",
"dependencies": {
"bcryptjs": "^2.4.3",
"body-parser": "^1.19.0",
"cors": "^2.8.5",
"dotenv": "^8.6.0",
"express": "^4.17.1",
+2 -2
View File
@@ -4,12 +4,12 @@ const { tokens } = require('../database/models');
const generate = require('./token-generate');
const destroy = require('./token-destroy');
module.exports = (token, callback) => {
module.exports = async (token, callback) => {
if (!token) {
return callback(401);
}
const tokenRecord = tokens.findOne({
const tokenRecord = await tokens.findOne({
where: {
token: token || ''
}
+4 -2
View File
@@ -15,8 +15,8 @@ POST http://127.0.0.1:3200/auth/login HTTP/1.1
Content-Type: application/json
{
"email": "kayneruse@gmail.com",
"password": "helloworld"
"email": "admin@example.com",
"password": "password"
}
###
@@ -66,3 +66,5 @@ Content-Type: application/json
{
"password": "helloworld"
}
###