mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-16 19:33:09 -06:00
Added duplicate check to AddCompletedSessionStage
This commit is contained in:
parent
3ee590c570
commit
b50455ee61
|
|
@ -91,6 +91,11 @@ func newSessionsDict() *sessionsDict {
|
||||||
|
|
||||||
// AddCompletedSessionStage records that a session has completed an auth stage.
|
// AddCompletedSessionStage records that a session has completed an auth stage.
|
||||||
func AddCompletedSessionStage(sessionID string, stage authtypes.LoginType) {
|
func AddCompletedSessionStage(sessionID string, stage authtypes.LoginType) {
|
||||||
|
for _, completedStage := range sessions.GetCompletedStages(sessionID) {
|
||||||
|
if completedStage == stage {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
sessions.sessions[sessionID] = append(sessions.GetCompletedStages(sessionID), stage)
|
sessions.sessions[sessionID] = append(sessions.GetCompletedStages(sessionID), stage)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue