mirror of
				https://github.com/gravitl/netmaker.git
				synced 2025-11-01 00:49:04 +08:00 
			
		
		
		
	fix(go): delete pending user on sync;
This commit is contained in:
		
							parent
							
								
									7aef92aa42
								
							
						
					
					
						commit
						b76a09e571
					
				
					 1 changed files with 7 additions and 0 deletions
				
			
		|  | @ -150,6 +150,13 @@ func syncUsers(idpUsers []idp.User) error { | |||
| 			if err != nil { | ||||
| 				return err | ||||
| 			} | ||||
| 
 | ||||
| 			// It's possible that a user can attempt to log in to Netmaker | ||||
| 			// after the IDP is configured but before the users are synced. | ||||
| 			// Since the user doesn't exist, a pending user will be | ||||
| 			// created. Now, since the user is created, the pending user | ||||
| 			// can be deleted. | ||||
| 			_ = logic.DeletePendingUser(user.Username) | ||||
| 		} else if dbUser.AuthType == models.OAuth { | ||||
| 			if dbUser.AccountDisabled != user.AccountDisabled || | ||||
| 				dbUser.DisplayName != user.DisplayName || | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue