-
Notifications
You must be signed in to change notification settings - Fork 30
feat: Implement Authentication Component Suite for Storacha Console Toolkit #423
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
base: main
Are you sure you want to change the base?
feat: Implement Authentication Component Suite for Storacha Console Toolkit #423
Conversation
|
@Dhruv-Varshney-developer Could you please review the PR. |
307abdf to
5aa8c7d
Compare
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.
LGTM, great work!
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.
Mostly Looks good to me. Except that I'll prefer the code to refactored & simplified.
Few good practices:
- Big files (more than 200 lines of code) can be split into small components and those components can go in
/components - Look for code where it can be deleted/simplified.
- If we can use Tailwind, libraries and toolkit and can reduce code, that's helpful.
5aa8c7d to
6a5b61e
Compare
|
@Dhruv-Varshney-developer @travis Ready for the second round of review |
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.
This is great work, thank you!
Two things that need to be changed before I'm comfortable with this merging:
- Components that include CSS or styling belong in a separate package - this package intentionally does not include CSS and should not be expanded to include components with built-in styling choices. I'd recommend a new package called
react-styledor something similar - Needs more usage examples - the
sign-up-inupdates are great! I'd like a bit more documentation and a few more examples of the functionality you're introducing here. In particular, a) this needs an example of how to swap in your own styles rather than using the prepackaged ones and b) this needs examples of and documentation for the "iframe" support
Happy to chat in higher bandwidth in Discord if that would be helpful!
| import { useStorachaAuth } from '../components/StorachaAuth.js' | ||
|
|
||
| /** | ||
| * Enhanced authentication hook that provides additional functionality |
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.
what additional functionality does it provide?
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.
The enhanced hook basically builds on top of useStorachaAuth and gives some extra handy stuff. It provides the current user info (currentUser), session details like duration and iframe state (sessionInfo), a logout method with tracking and convenience flags like isLoading and isSubmitting. Makes it easier to use in the UI without manually calculating these.
|
This update implements a headless-first architecture for StorachaAuth with a separate styled layer, as per requested by @travis Key ChangesSeparated styling from core logic
Added three new example apps
Enhanced developer flexibility
|
0b75f0c to
6fd41c0
Compare
6fd41c0 to
de6f149
Compare
Overview
Implements a complete authentication component suite (
StorachaAuth) that transforms@storacha/uifrom a low-level SDK into a plug-and-play UI toolkit. This allows partner apps to embed Storacha console authentication features natively without double navigation UX friction.Features
useStorachaAuthanduseStorachaAuthEnhancedfor custom implementationsImplementation
StorachaAuth,StorachaAuthForm,StorachaAuthSubmitted,StorachaAuthEnsureruseStorachaAuth,useStorachaAuthEnhancedwith session trackingUsage
Testing
Screenshot
Part of #400
Closes #399