Support signing with another device

This commit is contained in:
Kgothatso
2019-12-04 21:46:42 +02:00
parent 2ae4fec812
commit 44fcf30df8
6 changed files with 264 additions and 25 deletions

View 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;
};