rainbowkit
rainbowkit copied to clipboard
[bug] Custom Authentication adapter is not working
Is there an existing issue for this?
- [X] I have searched the existing issues
RainbowKit Version
0.5.0
wagmi Version
0.6.0
Current Behavior
I am using custom auth adapter following the steps mentioned here https://www.rainbowkit.com/docs/custom-authentication
but when I verify the signature, if we return true from the verify function it is just stuck at this

if I return false it notifies that there is an error, but for success case it is stuck. If i refresh it works.
Expected Behavior
Expected behavior is that the modal closes and I am logged in.
Steps To Reproduce
- yarn create rainbow-kit
- add custom authentication adapter
Link to Minimal Reproducible Example (CodeSandbox, StackBlitz, etc.)
https://stackblitz.com/edit/next-typescript-by4kmo?file=pages/index.tsx
No response
Anything else?
No response
Same issue
@avp1598 The issue for me was that the state of AUTHENTICATION_STATUS wasn't changing after succesfully verifying the sign transaction. create a state variable loginStatus which changes after the verify step, and listen to that variable in the useEffect so you can check with your backend whether you are authenticated or not.
@KaladinStormBlessed16 how to update state variable in the authentication adapter? we can only update it in a react component right? can you share some example
@avp1598 I moved the authenticationAdapter inside of the component so I have access to state variables.
@KaladinStormBlessed16 thanks a lot works now! but the docs do need to be more clearer
@avp1598 Are you able to share a StackBlitz link for your fixed version?
@markdalgleish hey so i just updated the original stackblitz with the fixed version. https://stackblitz.com/edit/next-typescript-by4kmo?file=pages/_app.tsx
Basically need to update the AUTHENTICATION_STATUS as mentioned by @KaladinStormBlessed16 in the custom auth adapater, please add this info in the docs.