Testing and Troubleshooting
Run tests and troubleshoot SIWA Connect
Common Issues and Solutions
Issue 1: Connection Error
Description: Unable to connect to the wallet.
Solution: Ensure your wallet app is updated to the latest version and check your internet connection. Try clearing browser cache and reloading the page.
Issue 2: Signature Request Fails
Description: Signature request is not approved.
Solution: Double-check that you are signed into the correct wallet in the app. Verify wallet permissions and restart the application if needed.
Issue 3: SIWA Verification Error
Description: SIWA message verification fails.
Solution: Confirm the integrity of the backend service handling the SIWA message. Check server logs for detailed error messages and ensure the server is correctly configured to handle authentication requests.
Navigate to http://localhost:3000
in your browser.
Testing the Authentication Flow
Click on either the "Connect Pera Wallet" or "Connect Defly Wallet" button.
Approve the connection in your wallet app.
Once connected, click the "Sign In" button.
Approve the signature request in your wallet app.
Click the "Verify SIWA Message" button.
If successful, you should see a success message.
Common Issues and Solutions
Wallet Not Connecting
If you're having trouble connecting your wallet:
Ensure your wallet app is installed and set up correctly.
Check that you're on the correct network (testnet or mainnet) in your wallet app.
Signature Verification Failing
If the signature verification is failing:
Check the console for any error messages.
Ensure that the
chainId
in theSiwaMessage
creation matches your current network.Verify that the
nonce
is being generated uniquely for each request.
UI Not Updating Correctly
If the UI is not updating as expected:
Check that all state variables are being updated correctly in the
SIWAConnect
component.Verify that the
activeStep
state is being set correctly at each stage of the process.
Debugging Tips
Use
console.log
statements to track the flow of data through your application.Utilize the React Developer Tools browser extension to inspect component state and props.
Check the Network tab in your browser's developer tools to ensure API requests are being made correctly.
Getting Help
If you're still having issues:
Check the SIWA documentation for any updates or known issues.
Post your question on the Algorand Developer Forum.
Join the Algorand Discord and ask for help in the appropriate channel.
Remember to always provide as much detail as possible about your issue, including any error messages, when seeking help.
Last updated