feat: Improve security of access tokens (#279)

Closes #275
This commit is contained in:
SimonTagne
2022-08-09 18:03:21 +02:00
committed by GitHub
parent 77ac2cf1b1
commit 2b4c2b0f49
40 changed files with 273 additions and 133 deletions

View File

@@ -67,6 +67,10 @@ module.exports = {
type: 'ref',
columnName: 'deleted_at',
},
passwordChangedAt: {
type: 'ref',
columnName: 'password_changed_at',
},
// ╔═╗╔╦╗╔╗ ╔═╗╔╦╗╔═╗
// ║╣ ║║║╠╩╗║╣ ║║╚═╗
@@ -102,7 +106,7 @@ module.exports = {
customToJSON() {
return {
..._.omit(this, ['password', 'avatarDirname']),
..._.omit(this, ['password', 'avatarDirname', 'passwordChangedAt']),
avatarUrl:
this.avatarDirname &&
`${sails.config.custom.userAvatarsUrl}/${this.avatarDirname}/square-100.jpg`,