This commit is contained in:
Denis Arnst 2026-02-24 13:49:53 +04:00 committed by GitHub
commit 58b0358600
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 3371 additions and 581 deletions

View file

@ -18,6 +18,10 @@ class Session extends Model {
this.userId
/** @type {Date} */
this.expiresAt
/** @type {string} */
this.oidcIdToken
/** @type {string} */
this.oidcSessionId
// Expanded properties
@ -25,8 +29,8 @@ class Session extends Model {
this.user
}
static async createSession(userId, ipAddress, userAgent, refreshToken, expiresAt) {
const session = await Session.create({ userId, ipAddress, userAgent, refreshToken, expiresAt })
static async createSession(userId, ipAddress, userAgent, refreshToken, expiresAt, oidcIdToken = null, oidcSessionId = null) {
const session = await Session.create({ userId, ipAddress, userAgent, refreshToken, expiresAt, oidcIdToken, oidcSessionId })
return session
}
@ -66,7 +70,9 @@ class Session extends Model {
expiresAt: {
type: DataTypes.DATE,
allowNull: false
}
},
oidcIdToken: DataTypes.TEXT,
oidcSessionId: DataTypes.STRING
},
{
sequelize,