Implement JWT authentication and user token management

This commit is contained in:
Torsten Schulz
2025-07-17 11:47:37 +02:00
parent ad2ab3cae8
commit 353b8386ee
4 changed files with 44 additions and 19 deletions

View File

@@ -0,0 +1,20 @@
import { DataTypes } from 'sequelize';
import sequelize from '../database.js'; // Korrigierter Pfad
const UserToken = sequelize.define('UserToken', {
userId: {
type: DataTypes.INTEGER,
allowNull: false,
},
token: {
type: DataTypes.STRING,
allowNull: false,
unique: true,
},
expiresAt: {
type: DataTypes.DATE,
allowNull: false,
},
});
export default UserToken;