ejs templating

This commit is contained in:
newtbot
2024-01-19 03:21:15 +08:00
parent 4e4e8bfee2
commit 908a8bd351
15 changed files with 648 additions and 713 deletions

View File

@ -45,7 +45,7 @@ const apikeyModel = sequelize.define(
validate: {
notEmpty: true,
len: [1, 255],
isIn: [["canRead", "canWrite"]],
isIn: [["canRead", "canWrite" , "auto-generated"]],
},
},
createdAt: {
@ -63,3 +63,46 @@ const apikeyModel = sequelize.define(
);
module.exports = { apikeyModel };
/*
class AuthToken extends Model {
check(){
// check expires_on date
return this.is_valid;
}
}
AuthToken.init({
token:{
type: DataTypes.UUID,
defaultValue: DataTypes.UUIDV4,
allowNull: false,
primaryKey: true
},
expires_on: {
type: DataTypes.DATE,
allowNull: true,
validate:{
isDate:true
}
},
username: {
type: DataTypes.STRING,
ldapModel: 'User',
allowNull: false,
validate:{
notNull: true,
},
},
is_valid: {
type: DataTypes.BOOLEAN,
defaultValue: true
}
}, {
sequelize,
modelName: 'AuthToken',
});
*/