- Parte 3 : Viaggi

- Chat
This commit is contained in:
Surya Paolo
2025-12-24 00:26:38 +01:00
parent b78e3ce544
commit cb965eaa27
20 changed files with 1752 additions and 793 deletions

View File

@@ -55,7 +55,11 @@ class UserController {
}
// Send response with tokens
res.header('x-auth', result.token).header('x-refrtok', result.refreshToken).header('x-browser-random', result.browser_random).send(result.user);
res
.header('x-auth', result.token)
.header('x-refrtok', result.refreshToken)
.header('x-browser-random', result.browser_random)
.send(result.user);
} catch (error) {
console.error('Error in registration:', error.message);
res.status(400).send({
@@ -103,11 +107,15 @@ class UserController {
}
// Send response with tokens
res.header('x-auth', result.token).header('x-refrtok', result.refreshToken).header('x-browser-random', result.browser_random).send({
usertosend: result.user,
code: server_constants.RIS_CODE_OK,
subsExistonDb: result.subsExistonDb,
});
res
.header('x-auth', result.token)
.header('x-refrtok', result.refreshToken)
.header('x-browser-random', result.browser_random)
.send({
usertosend: result.user,
code: server_constants.RIS_CODE_OK,
subsExistonDb: result.subsExistonDb,
});
} catch (error) {
console.error('Error in login:', error.message);
res.status(400).send({
@@ -487,6 +495,7 @@ class UserController {
const { User } = require('../models/user');
return User.isCollaboratore(user.perm);
}
}
module.exports = UserController;