Skip to content
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

Single oauth button #7063

Merged
merged 10 commits into from Jan 23, 2024
Merged

Single oauth button #7063

merged 10 commits into from Jan 23, 2024

Conversation

Wauplin
Copy link
Contributor

@Wauplin Wauplin commented Jan 18, 2024

The goal of this PR is to deprecated the use of gr.LogoutButton in favor of a single gr.LoginButton. When the user land on the Space page, the button shows "Sign in with Hugging Face". Once the user is logged in, the button shows "Logout (Wauplin)". This should be cleaner to avoid having a gr.LogoutButton always shown even if the user if not logged in yet.
Logic-wise, I have added a logout_value similar to signed_in_value. I also fixed the JS part to take this into account.

See slack discussion (internal) cc @julien-c.

Demo: https://huggingface.co/spaces/Wauplin/gradio-oauth-demo-pr-7063

When landing on Space:

image

Once logged in:
image

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Jan 18, 2024

🪼 branch checks and previews

Name Status URL
🦄 Changes detected! Details

@gradio-pr-bot
Copy link
Contributor

gradio-pr-bot commented Jan 18, 2024

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio minor
  • Maintainers can select this checkbox to manually select packages to update.

With the following changelog entry.

Single oauth button

Maintainers or the PR author can modify the PR title to modify this entry.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

gradio/components/login_button.py Outdated Show resolved Hide resolved
gradio/components/login_button.py Outdated Show resolved Hide resolved
@Wauplin Wauplin marked this pull request as ready for review January 18, 2024 16:41
Copy link
Member

@abidlabs abidlabs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Wauplin for this PR. I've left a couple of small notes above but LGTM

@Wauplin
Copy link
Contributor Author

Wauplin commented Jan 23, 2024

Thanks for the review @abidlabs! I've addressed your two comments. Feel free to merge anytime (CI is red but it's related to a permission issue I believe).

@abidlabs
Copy link
Member

LGTM, thanks for addressing @Wauplin!

@abidlabs abidlabs merged commit 2cdcf4a into gradio-app:main Jan 23, 2024
8 of 13 checks passed
@pngwn pngwn mentioned this pull request Jan 23, 2024
@pngwn pngwn mentioned this pull request Mar 14, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants