added api page
added login added api.ejs added middleware for authorization check
This commit is contained in:
@ -61,6 +61,7 @@ const apikeyModel = sequelize.define(
|
||||
timestamps: true,
|
||||
}
|
||||
);
|
||||
apikeyModel.belongsTo(userModel);
|
||||
|
||||
module.exports = { apikeyModel };
|
||||
|
||||
|
@ -19,6 +19,26 @@ const userModel = sequelize.define(
|
||||
isNumeric: true,
|
||||
},
|
||||
},
|
||||
firstname: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
length: 60,
|
||||
validate: {
|
||||
notEmpty: true,
|
||||
len: [1, 60],
|
||||
isAlpha: true, // will only allow letters
|
||||
},
|
||||
},
|
||||
lastname: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
length: 60,
|
||||
validate: {
|
||||
notEmpty: true,
|
||||
len: [1, 60],
|
||||
isAlpha: true, // will only allow letters
|
||||
},
|
||||
},
|
||||
username: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
|
Reference in New Issue
Block a user