MCPcopy Create free account
hub / github.com/daodst/chat / addCompletedSessionStage

Method addCompletedSessionStage

clientapi/routing/register.go:161–171  ·  view source on GitHub ↗

addCompletedSessionStage records that a session has completed an auth stage also starts a timer to delete the session once done.

(sessionID string, stage authtypes.LoginType)

Source from the content-addressed store, hash-verified

159// addCompletedSessionStage records that a session has completed an auth stage
160// also starts a timer to delete the session once done.
161func (d *sessionsDict) addCompletedSessionStage(sessionID string, stage authtypes.LoginType) {
162 d.startTimer(defaultTimeOut, sessionID)
163 d.Lock()
164 defer d.Unlock()
165 for _, completedStage := range d.sessions[sessionID] {
166 if completedStage == stage {
167 return
168 }
169 }
170 d.sessions[sessionID] = append(sessions.sessions[sessionID], stage)
171}
172
173func (d *sessionsDict) addDeviceToDelete(sessionID, deviceID string) {
174 d.startTimer(defaultTimeOut, sessionID)

Callers 5

handleRegistrationFlowFunction · 0.80
AuthFallbackFunction · 0.80
PasswordFunction · 0.80
TestSessionCleanUpFunction · 0.80

Calls 3

startTimerMethod · 0.95
LockMethod · 0.80
UnlockMethod · 0.80

Tested by 1

TestSessionCleanUpFunction · 0.64