Priority: high
Description
The useFreighter hook implements the SEP-10 flow and is critical to the authentication experience. Unit tests should cover the happy path and all failure modes.
Acceptance Criteria
- Test:
connect() calls POST /auth/sep10 and then POST /auth/verify
- Test: Freighter signing failure sets
error state
- Test: backend 401 on verify sets
error state
- Test: successful connect sets
isConnected: true and publicKey
- Test:
disconnect() clears JWT and resets state
Priority: high
Description
The
useFreighterhook implements the SEP-10 flow and is critical to the authentication experience. Unit tests should cover the happy path and all failure modes.Acceptance Criteria
connect()callsPOST /auth/sep10and thenPOST /auth/verifyerrorstateerrorstateisConnected: trueandpublicKeydisconnect()clears JWT and resets state