This commit is contained in:
xfarrow 2024-02-19 16:02:30 +01:00
parent 468ca5224c
commit 8d6acf5ac6
4 changed files with 6 additions and 4 deletions

View File

@ -15,7 +15,7 @@
const express = require('express'); const express = require('express');
const cors = require('cors'); const cors = require('cors');
const rateLimit = require('express-rate-limit'); const rateLimit = require('express-rate-limit');
const apiController = require('./api_controller.js'); const apiController = require('./controllers/api_controller.js');
require('dotenv').config(); require('dotenv').config();
// Application configuration // Application configuration
@ -34,8 +34,8 @@ publicRoutes.post('/login', apiController.login);
const protectedRoutes = express.Router(); const protectedRoutes = express.Router();
protectedRoutes.use(apiController.verifyToken); protectedRoutes.use(apiController.verifyToken);
protectedRoutes.get('/person/:id', apiController.getPerson);
protectedRoutes.get('/person/myself', apiController.getMyself); protectedRoutes.get('/person/myself', apiController.getMyself);
protectedRoutes.get('/person/:id', apiController.getPerson);
protectedRoutes.put('/person/:id', apiController.updatePerson); protectedRoutes.put('/person/:id', apiController.updatePerson);
protectedRoutes.delete('/person/delete', apiController.deletePerson); protectedRoutes.delete('/person/delete', apiController.deletePerson);
protectedRoutes.post('/organization/admin', apiController.addOrganizationAdmin); protectedRoutes.post('/organization/admin', apiController.addOrganizationAdmin);

View File

@ -173,6 +173,8 @@ async function getMyself(req, res){
.where({ id: req.jwt.person_id }) .where({ id: req.jwt.person_id })
.first(); .first();
console.log(req.jwt.person_id);
if(person){ if(person){
delete person['password']; delete person['password'];
return res.status(200).send(person); return res.status(200).send(person);

View File

@ -35,7 +35,7 @@ In nessun caso saremo responsabili per danni diretti, indiretti, punitivi, incid
<h3>7. Legge Applicabile</h3> <h3>7. Legge Applicabile</h3>
Questi Termini saranno regolati e interpretati in conformità alle leggi [Nome del tuo Paese], senza considerare i suoi principi di conflitto di leggi. Questi Termini saranno regolati e interpretati in conformità alle leggi della Repubblica Italiana.
<h3>8. Modifiche ai Termini</h3> <h3>8. Modifiche ai Termini</h3>

View File

@ -37,7 +37,7 @@ In no event shall we be liable for any direct, indirect, punitive, incidental, s
<h3>7. Governing Law</h3> <h3>7. Governing Law</h3>
These Terms shall be governed by and construed in accordance with the laws of [Your Country], without regard to its conflict of law provisions. These Terms shall be governed by and construed in accordance with the laws of the Italian Republic.
<h3>8. Changes to Terms</h3> <h3>8. Changes to Terms</h3>