aboutsummaryrefslogtreecommitdiff
path: root/clientapi/routing/register.go
diff options
context:
space:
mode:
Diffstat (limited to 'clientapi/routing/register.go')
-rw-r--r--clientapi/routing/register.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/clientapi/routing/register.go b/clientapi/routing/register.go
index 243f9dd2..fa15f4fc 100644
--- a/clientapi/routing/register.go
+++ b/clientapi/routing/register.go
@@ -85,6 +85,12 @@ func (d sessionsDict) GetCompletedStages(sessionID string) []authtypes.LoginType
// AddCompletedStage records that a session has completed an auth stage.
func (d *sessionsDict) AddCompletedStage(sessionID string, stage authtypes.LoginType) {
+ // Return if the stage is already present
+ for _, completedStage := range d.GetCompletedStages(sessionID) {
+ if completedStage == stage {
+ return
+ }
+ }
d.sessions[sessionID] = append(d.GetCompletedStages(sessionID), stage)
}