Compare commits
	
		
			2 Commits
		
	
	
		
			ab248fb9c3
			...
			f99d069d61
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						
						
							
						
						f99d069d61
	
				 | 
					
					
						|||
| 
						
						
							
						
						7c710d2236
	
				 | 
					
					
						
@ -36,8 +36,10 @@ if not exists(Path("accounts.txt").absolute()):
 | 
			
		||||
    print("Missing accounts.txt!")
 | 
			
		||||
    exit(1)
 | 
			
		||||
 | 
			
		||||
with open("emails.txt") as handle:
 | 
			
		||||
    emails = handle.readlines()
 | 
			
		||||
with open("accounts.txt") as handle:
 | 
			
		||||
    emails = [email.strip() for email in handle.readlines()]
 | 
			
		||||
 | 
			
		||||
print(f"Parsed {emails} from accounts.txt")
 | 
			
		||||
 | 
			
		||||
keycloak = init_keycloak()
 | 
			
		||||
 | 
			
		||||
@ -58,10 +60,13 @@ for email in emails:
 | 
			
		||||
 | 
			
		||||
    try:
 | 
			
		||||
        user_id = keycloak.create_user(payload, exist_ok=False)
 | 
			
		||||
        print(f"Account created for {email}")
 | 
			
		||||
        keycloak.send_update_account(
 | 
			
		||||
            user_id=user_id, payload=json.dumps(["UPDATE_PASSWORD", "UPDATE_PROFILE"])
 | 
			
		||||
        )
 | 
			
		||||
        print(f"UPDATE_PASSWORD/PROFILE actions set for {email}")
 | 
			
		||||
        keycloak.send_verify_email(user_id=user_id)
 | 
			
		||||
        print(f"Verification mail sent to {email}")
 | 
			
		||||
    except Exception as exception:
 | 
			
		||||
        print(f"Keycloak user registration failed, saw: {exception}")
 | 
			
		||||
        if not confirm():
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user