-
Notifications
You must be signed in to change notification settings - Fork 5
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
feat github middleware #41
feat github middleware #41
Conversation
✅ Deploy Preview for gno-faucet-hub ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
src/data/faucets.json
Outdated
"name": "Teritori Faucet", | ||
"chain_id": "test5", | ||
"amounts": [1, 5, 10], | ||
"url": "http://localhost:5050", |
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.
Just to be sure: will this entry be removed or changed to a public hostname before merging?
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.
Hello :)
thanks for the review yes it is just for testing, I think we can leave the comment to change it before merge
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.
Changed here thanks for your review: 👍
2c849c3
I had a chat with @zxxma. I'm gonna take care of the UI side this week. |
@Villaquiranm could you give me access to your fork so I can polish the front-end side in the PR? :) |
hello @alexiscolin yeah sure but It is a public repo, let me know what do you want me to do |
@Villaquiranm Should be better like that. However, we will need to setup the right info in the JSON as @aeddi mentioned. |
I've
|
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.
We can go the extra step and improve the UI a bit more 🙏
The modal that has the GH authentication should also have clear visual cues that a GH authentication is needed, I've attached a mockup below. It's a subtle change, but really improves the UX, as I'm not randomly redirected to the GH application page when I click "Request drip"
@alexiscolin what do you think?

@zivkovicmilos I totally agree that we should make it clearer that GitHub authentication is required. That’s a great UX improvement 🙏 However, I’d suggest avoiding having two separate buttons (one for GH auth and another for the request), since the current flow performs both actions at once. Displaying two buttons might give the user a false sense of choice, which doesn’t exist in the actual backend logic. Instead, what about updating the single button to include a GitHub icon and clearer text, something like “Get Drip with GitHub” (or even shorter)? That way, it remains visually explicit and stays aligned with the actual flow. |
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.
@alexiscolin
Works for me ✅
@Villaquiranm @alexiscolin |
@zivkovicmilos @alexiscolin |
related to #3781 Related faucet-hub PR: gnolang/faucet-hub#41 This pull request introduces two key features to gnofaucet: **getGithubMiddleware**: A new middleware that checks for a code query parameter in the URL. It attempts to exchange this code for a GitHub token via OAuth. If the code is valid, the middleware retrieves the GitHub login associated with the token. **Cooldown Period**: This feature allows for a configurable cooldown period (1 hour in this case). If the user attempts to claim tokens again before the cooldown period expires, the middleware will reject the request. Additionally, we could enhance the functionality by implementing checks for account age, pull requests, commits, or verifying if the user belongs to a specific organization. [screen-capture (8).webm](https://github.com/user-attachments/assets/336d6767-9c7a-49eb-b4f8-7a514def628a) --------- Co-authored-by: Your Name <you@example.com> Co-authored-by: Antoine Eddi <5222525+aeddi@users.noreply.github.com>
Related to gnolang/gno#3808, this PR implements the GitHub middleware in the faucet hub.