Support signing with another device
This commit is contained in:
41
persistence/models/challenge.js
Normal file
41
persistence/models/challenge.js
Normal file
@@ -0,0 +1,41 @@
|
||||
const bcrypt = require('bcrypt');
|
||||
|
||||
module.exports = function (sequelize, DataTypes, options) {
|
||||
const model = sequelize.define("challenge", {
|
||||
id: {
|
||||
type: DataTypes.STRING,
|
||||
defaultValue: function() {
|
||||
return options.generateUniqueId()
|
||||
},
|
||||
primaryKey: true,
|
||||
unique: true
|
||||
},
|
||||
message: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false
|
||||
},
|
||||
derivationPath: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false
|
||||
},
|
||||
xpub: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false
|
||||
},
|
||||
request: {
|
||||
type: DataTypes.JSON,
|
||||
allowNull: false
|
||||
},
|
||||
response: {
|
||||
type: DataTypes.JSON
|
||||
}
|
||||
}, {
|
||||
comment: "Challenge to be signed"
|
||||
});
|
||||
|
||||
model.associate = (db) => {
|
||||
|
||||
}
|
||||
|
||||
return model;
|
||||
};
|
||||
Reference in New Issue
Block a user