Unverified Commit d3f9a33f authored by Dannon's avatar Dannon Committed by GitHub
Browse files

Merge pull request #16251 from nuwang/fix_escape_of_preferred_username

[22.05] Slugify username received from oidc
parents 6d9b0fd2 791add01
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -381,6 +381,7 @@ class CustosAuthnz(IdentityProvider):
        username = userinfo.get("preferred_username", userinfo["email"])
        if "@" in username:
            username = username.split("@")[0]  # username created from username portion of email
        username = util.ready_name_for_url(username)
        if trans.sa_session.query(trans.app.model.User).filter_by(username=username).first():
            # if username already exists in database, append integer and iterate until unique username found
            count = 0