diff --git a/authentik/lib/avatars.py b/authentik/lib/avatars.py index 30a240b19..25e3e3763 100644 --- a/authentik/lib/avatars.py +++ b/authentik/lib/avatars.py @@ -154,7 +154,7 @@ def generate_avatar_from_name( def avatar_mode_generated(user: "User", mode: str) -> Optional[str]: """Wrapper that converts generated avatar to base64 svg""" - svg = generate_avatar_from_name(user.name if user.name != "" else "a k") + svg = generate_avatar_from_name(user.name if user.name.strip() != "" else "a k") return f"data:image/svg+xml;base64,{b64encode(svg.encode('utf-8')).decode('utf-8')}"