Skip to content

Strip usernames when creating them #60

@scottwoodall

Description

@scottwoodall

I ran into a situation today where duplicate user accounts were being created. After some digging around I noticed that if a user typed in a leading or trailing space while typing their username then it would treat these accounts as unique and create a new record in auth_user. This can lead to confusing results for the end user as anything associated with an account they might of had previously looks to them as if it disappeared.

Would you be willing to accept a patch for backends.py[1] with something to the effect of:

username = _verify(ticket, service)

if not username:
    return None

username = username.strip()

[1] https://github.com/kstateome/django-cas/blob/develop/cas/backends.py#L231

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions