-
Notifications
You must be signed in to change notification settings - Fork 264
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
✨ Introduce oauthLogin function #433
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Co-authored-by: Mishig <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting read, thanks for the ping. DX-wise looks good to me. Just to be sure, is oauthHandleRedirect
intended to be used or is it more like an internal helper and oauthHandleRedirectIfPresent
is meant to be used more often?
Small comment in the documentation, I would mention accessTokenExpiresAt
. In the Python+Gradio integration I think that the token expiration is one of the blocking aspect (or at least one frustrating aspect). Having it explicitly documented should help IMO (if was not the case in the gradio integration).
Overall the API looks good! can we test it already? |
Took comments under consideration:
Published a test version
|
https://huggingface.co/spaces/coyotte508/client-side-oauth uses the lib, checkout https://huggingface.co/spaces/coyotte508/client-side-oauth/blob/main/index.html |
cool, testing this https://huggingface.co/spaces/coyotte508/client-side-oauth , for some reason if I refresh the page I have to re-login to hf, but accessing it via https://coyotte508-client-side-oauth.static.hf.space/index.html I just need to click sign-in and no need to re-login, do you know why? |
Cookies storage inside iframes I guess, browser measures to prevent tracking |
2ee862d
to
9fe3416
Compare
Fix #408
Tested inside a space: https://huggingface.co/spaces/coyotte508/client-side-oauth
Mainly looking for reviews regarding the APIs / usability cc @xenova @radames @vvmnnnkv @jbilcke-hf @Wauplin .
I started with a single
oauthLogin
that was split intooauthLogin
andoauthHandleRedirect
with an extraoauthHandleRedirectIfPresent
for convenience.