Skip to content

Commit

Permalink
Changes for log, version and fix (#7)
Browse files Browse the repository at this point in the history
- Less verbose logging
- Included version endpoint
- fixed the issue of deleting token
  • Loading branch information
pankajupadhyay29 committed Mar 8, 2024
1 parent b389738 commit 903b31a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion api/tokens.js
@@ -1,6 +1,6 @@
const _ = require('lodash');
const utils = require('../utils');
const { setData, getData } = require('../utils/redis');
const { setData, getData, deleteKey } = require('../utils/redis');

const tokens = {};

Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "mock-auth-server",
"version": "2.0.1",
"version": "2.0.2",
"description": "Mock for Open ID Connect base authentication server for testing",
"repository": {
"type": "git",
Expand Down
8 changes: 4 additions & 4 deletions server.js
Expand Up @@ -7,6 +7,7 @@ const path = require('path');
const express = require('express');
const cookieParser = require('cookie-parser');
const bodyParser = require('body-parser');
const packageJson = require('./package.json');

const app = express();
const utils = require('./utils');
Expand All @@ -32,10 +33,9 @@ utils.populateOptions().then(() => {

const server = createServer(app);

app.use((req, res, next) => {
console.log(`Request for ${req.originalUrl} and parameters are ${JSON.stringify(req.query)}`);
next();
})
app.route('/version').get((req, res) => {
res.send(packageJson.version);
});

app.route('/authorize').get(authorize);
app.route('/oauth/token').post(token);
Expand Down

0 comments on commit 903b31a

Please sign in to comment.