Skip to content

Commit b76a09e

Browse files
committed
fix(go): delete pending user on sync;
1 parent 7aef92a commit b76a09e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pro/auth/sync.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,13 @@ func syncUsers(idpUsers []idp.User) error {
150150
if err != nil {
151151
return err
152152
}
153+
154+
// It's possible that a user can attempt to log in to Netmaker
155+
// after the IDP is configured but before the users are synced.
156+
// Since the user doesn't exist, a pending user will be
157+
// created. Now, since the user is created, the pending user
158+
// can be deleted.
159+
_ = logic.DeletePendingUser(user.Username)
153160
} else if dbUser.AuthType == models.OAuth {
154161
if dbUser.AccountDisabled != user.AccountDisabled ||
155162
dbUser.DisplayName != user.DisplayName ||

0 commit comments

Comments
 (0)