Fixed multiple bugs

This commit is contained in:
Torsten Schulz
2025-07-17 13:56:34 +02:00
parent 353b8386ee
commit e827964688
7 changed files with 105 additions and 67 deletions

View File

@@ -63,4 +63,8 @@ const User = sequelize.define('User', {
},
});
User.prototype.validatePassword = function(password) {
return bcrypt.compare(password, this.password);
};
export default User;

View File

@@ -27,6 +27,7 @@ import TournamentMember from './TournamentMember.js';
import TournamentMatch from './TournamentMatch.js';
import TournamentResult from './TournamentResult.js';
import Accident from './Accident.js';
import UserToken from './UserToken.js';
User.hasMany(Log, { foreignKey: 'userId' });
Log.belongsTo(User, { foreignKey: 'userId' });
@@ -203,4 +204,5 @@ export {
TournamentMatch,
TournamentResult,
Accident,
UserToken,
};