mkhorasani/Streamlit-Authenticator

validate_name function validation issues

wyzdic opened this issue · 1 comments

def validate_name(self, name: str) -> bool:
"""
Checks the validity of the entered name.

    Parameters
    ----------
    name: str
        The name to be validated.

    Returns
    -------
    bool
        Validity of entered name.
    """
    pattern = r"^[A-Za-z ]+$"
    return 1 <= len(name) <= 100 and bool(re.match(pattern, name))

This function prevents the user name from being set to Chinese characters

@wyzdic thank you for bringing this to my attention, I have already made the appropriate changes and will push it in the next release. In the meantime, I recommend you pass your own customized validator object to the authenticate class, for further information please refer to this file.