MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / dbUserSessionToModel

Function dbUserSessionToModel

server-source-code/internal/store/convert.go:218–236  ·  view source on GitHub ↗
(u db.UserSession)

Source from the content-addressed store, hash-verified

216}
217
218func dbUserSessionToModel(u db.UserSession) models.UserSession {
219 return models.UserSession{
220 ID: u.ID,
221 UserID: u.UserID,
222 RefreshToken: u.RefreshToken,
223 AccessTokenHash: u.AccessTokenHash,
224 IPAddress: u.IpAddress,
225 UserAgent: u.UserAgent,
226 DeviceFingerprint: u.DeviceFingerprint,
227 LastActivity: pgTime(u.LastActivity),
228 ExpiresAt: pgTime(u.ExpiresAt),
229 CreatedAt: pgTime(u.CreatedAt),
230 IsRevoked: u.IsRevoked,
231 TfaRememberMe: u.TfaRememberMe,
232 TfaBypassUntil: pgTimePtr(u.TfaBypassUntil),
233 LoginCount: int(u.LoginCount),
234 LastLoginIP: u.LastLoginIp,
235 }
236}
237
238func dbFindSessionWithTfaBypassRowToModel(u db.FindSessionWithTfaBypassRow) models.UserSession {
239 return models.UserSession{

Callers 4

updateExistingSessionMethod · 0.85
GetByRefreshTokenMethod · 0.85
GetByIDMethod · 0.85
ListByUserIDMethod · 0.85

Calls 2

pgTimePtrFunction · 0.85
pgTimeFunction · 0.70

Tested by

no test coverage detected