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)
| 159 | // addCompletedSessionStage records that a session has completed an auth stage |
| 160 | // also starts a timer to delete the session once done. |
| 161 | func (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 | |
| 173 | func (d *sessionsDict) addDeviceToDelete(sessionID, deviceID string) { |
| 174 | d.startTimer(defaultTimeOut, sessionID) |