-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Strip username before login and add unit test #5095
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
GitHub actions yielded the following error. The command that failed is
This is likely a linting or type-checking issue with the source code. |
GitHub actions yielded the following error. The command that failed is
This is likely a linting or type-checking issue with the source code. |
No need to add the changelogs. I'll do it myself |
Delete the file |
Chromatic build successful 🎉 |
Description
This PR addresses issue #5056 by adding functionality to strip leading and trailing spaces from the username during the login process. The changes are made in the
login
function in thegradio/routes.py
script. Additionally, a unit test is added in thetest/test_routes.py
script to ensure the stripping functionality works as expected.Summary of Changes
login
function ingradio/routes.py
to strip leading and trailing spaces from the username before processing the login.test/test_routes.py
to test the login route with a username that has leading and trailing spaces. The test asserts that the login is successful and the username stored in the session is the stripped username.Please review and merge this PR. Thank you!
Fixes #5056.
To checkout this PR branch, run the following command in your terminal:
To get Sweep to edit this pull request, leave a comment below or in the code. Leaving a comment in the code will only modify the file but commenting below can change the entire PR.