mirror of
https://github.com/LukasKanka/api_test.git
synced 2026-11-11 06:34:36 +01:00
- Move web/backend to backends/potter-api - Move web/frontend to backends/potter-api/frontend - Add root package.json with npm workspaces - Update README.md with monorepo navigation - Update .github/workflows/api-tests.yml for dynamic test discovery - Update bruno_test_scenario.md paths - Fix .gitignore to allow JSON data files - Add three new AI tests in apiTest/PotterAPI/AI/ Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
15 lines
295 B
JavaScript
15 lines
295 B
JavaScript
let jwt = require('jsonwebtoken');
|
|
module.exports = checkToken;
|
|
|
|
function checkToken(req, res, next) {
|
|
jwt.verify(req.token, 'secretkey', (err, authData) => {
|
|
if (err) {
|
|
res.status(403);
|
|
res.send(err);
|
|
} else {
|
|
next();
|
|
}
|
|
})
|
|
}
|
|
|