Add refreshToken to IntegrationAuthentication

This commit is contained in:
Tom Moor
2024-03-17 13:23:20 -04:00
parent 64bcf40edd
commit 988a4c5ac1
2 changed files with 24 additions and 0 deletions

View File

@@ -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");
}
};

View File

@@ -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")