From b50455ee61ceac9a84e140b636db59824c1f4893 Mon Sep 17 00:00:00 2001 From: Parminder Singh Date: Wed, 14 Aug 2019 00:08:09 +0530 Subject: [PATCH] Added duplicate check to AddCompletedSessionStage --- clientapi/routing/register.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clientapi/routing/register.go b/clientapi/routing/register.go index 2578180db..0af407587 100644 --- a/clientapi/routing/register.go +++ b/clientapi/routing/register.go @@ -91,6 +91,11 @@ func newSessionsDict() *sessionsDict { // AddCompletedSessionStage records that a session has completed an auth stage. 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) }