Add refreshToken to IntegrationAuthentication
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
async up (queryInterface, Sequelize) {
|
||||
await queryInterface.addColumn("authentications", "refreshToken", {
|
||||
type: Sequelize.BLOB,
|
||||
allowNull: true,
|
||||
});
|
||||
},
|
||||
|
||||
async down (queryInterface) {
|
||||
await queryInterface.removeColumn("authentications", "refreshToken");
|
||||
}
|
||||
};
|
||||
@@ -38,6 +38,16 @@ class IntegrationAuthentication extends IdModel<
|
||||
setEncryptedColumn(this, "token", value);
|
||||
}
|
||||
|
||||
@Column(DataType.BLOB)
|
||||
@Encrypted
|
||||
get refreshToken() {
|
||||
return getEncryptedColumn(this, "refreshToken");
|
||||
}
|
||||
|
||||
set refreshToken(value: string) {
|
||||
setEncryptedColumn(this, "refreshToken", value);
|
||||
}
|
||||
|
||||
// associations
|
||||
|
||||
@BelongsTo(() => User, "userId")
|
||||
|
||||
Reference in New Issue
Block a user