Giter Club home page Giter Club logo

Comments (5)

xavierraffin avatar xavierraffin commented on July 28, 2024 2

An additional feature will be to have access to current Auth.state. This way it is simpler for the developer to hide/display custom components based on that.

from amplify-ui.

wlee221 avatar wlee221 commented on July 28, 2024 2

Hello @xavierraffin, thank you for your detailed feature request! Looking over this now. This is something we want to support in our @next release as well!

Totally agreed on difficulty with reading and writing authState. Adding this to our new Authenticator GA milestone to track this.

On the new Authenticator, we'll provide mechanisms that provide you access to readonly authState and helpers that'll enable you to transition between different authStates. For React, it'll likely be a hook:

const { authState, toForgotPassword } = useAuthenticator(); 

which is a one-liner instead of onAuthUIStateChange callback that we used to have!

Edit: didn't read your thread well! Apologies.

from amplify-ui.

wlee221 avatar wlee221 commented on July 28, 2024

You can try or track the progress of our next authenticator on

  1. https://ui.docs.amplify.aws/ui/getting-started/installation?platform=react
  2. https://ui.docs.amplify.aws/ui/components/authenticator?platform=react

Please let us know if you have any suggestions or feedbacks!

from amplify-ui.

wlee221 avatar wlee221 commented on July 28, 2024

Hi @xavierraffin, apologies to keep you waiting. With @aws-amplify/[email protected], you are now able to add custom forgot password link in the footer through https://ui.docs.amplify.aws/components/authenticator#headers--footers without Hub workarounds. I'll be closing this issue as that use case is now supported.

That said though, I understand that the premise of this issue is not resolved (particularly read authState part). We would like to understand this use case a little bit better before we commit to a globally available hook. Can you please try out the new authenticator, and open a new feature request with what could be improved for which use case? Thanks in advance!

from amplify-ui.

wlee221 avatar wlee221 commented on July 28, 2024

Hi, came back to the issue! We just exposed useAuthenticator that you can use outside the authenticator to access or transition (ie. write) auth state. Please take a look and we gladly accept any feedbacks 🙏

Documentation is here: https://ui.docs.amplify.aws/components/authenticator#useauthenticator-hook

from amplify-ui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.