randydev commited on
Commit
8587052
·
verified ·
1 Parent(s): ad61b3a

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +1 -1
index.js CHANGED
@@ -159,7 +159,7 @@ app.post('/v1/generate-key', async (req, res) => {
159
  const existingUser = await collection.findOne({ owner: userIdNumber });
160
 
161
  if (existingUser) {
162
- return res.status(200).json({ apiKey: existingUser.key });
163
  }
164
  const userDocument = {
165
  key: newKey,
 
159
  const existingUser = await collection.findOne({ owner: userIdNumber });
160
 
161
  if (existingUser) {
162
+ return res.status(200).json({ apiKey: existingUser.key, createdAt: existingUser.createdAt });
163
  }
164
  const userDocument = {
165
  key: newKey,