-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Looking for an AuthStateProvider
for aws-amplify-react
#2236
Comments
@mrcoles having the same issue. I just wish they would have done it the same way firebase did it, so much easier... Let me know if you figure this out, would be glad to hear a solution |
After a lot of exploration and tinkering, I have ended up using the hosted UI (which requires a deep dive into configuring that along with cloudformation edits to add "email" as a username attribute—because I wanted login via email—and an extra lambda function to deal with uniqueness issues of emails—but the hosted UI seems to be the only way to get federated users into the cognito user pool) with my react app and I have written my own AuthProvider in the app (which is simpler when using the hosted UI). I could try to braindump this info at some point… I wish this were all easier to setup. |
Hitting this same issue. I'd love to either see the internal module exported, or an example of best practice. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Auth state is now provided via https://docs.amplify.aws/ui/auth/authenticator/q/framework/react#onauthuistatechange |
This issue has been automatically locked since there hasn't been any recent activity after it was closed. Please open a new issue for related bugs. Looking for a help forum? We recommend joining the Amplify Community Discord server |
Is your feature request related to a problem? Please describe.
I’m finding the
aws-amplify-react
classes too narrow in their application for how I’d like to setup auth on my web app. For example, I want to build a website that allows for both unauthenticated and authenticated users to visit it. I want to make the sign-up only require email + password (e.g., see this issue). I want the nav bar to show the logged-in/out state. I don’t want the login screen to be a subcomponent within the UI.Describe the solution you'd like
It seems like there should be a
Provider
component that you can wrap around your entire application, and then you can “connect” children components within the app to access the Provider state. Things that you might connect would be an AuthWidgets component (login/logout/forgot-password/verify) and maybe an account state in the nav. This is like the way redux does a provider model.Example:
index.js
components/Account.js
components/NavAccount.js
I saw there’s an AuthStateWrapper component hiding in this repo: Auth/AuthStateWrapper.jsx. It looks reasonably easy to convert to a Provider, but it’s not exposed by the
aws-amplify-react
package!Describe alternatives you've considered
Alternatives:
Auth
andHub
and avoidaws-amplify-react
Additional context
Am I potentially missing a key insight into how I should be using this library? 😬
The text was updated successfully, but these errors were encountered: