FCL: Check if user's wallet connection is still valid when creating an authorization request
See original GitHub issueProblem
Currently, FCL remembers when a user logs into a wallet and persists the connection when user comes back to the dApp page. This is great for UX.
When dApp calls the signing function from fcl.currentUser().authorization, FCL creates a POST request to initiate the authorization process.
However, the wallet connection might not be valid anymore at this time, if user comes back to the dApp long after they first logged in.
Currently there is no way for the wallet service to tell FCL that the connection is not valid anymore.
Expected
There may be multiple ways to improve the process.
- In the signature authorization request, define a response for the wallet service to tell FCL that the connection has already expired.
 - Before creating the authorization request, define an API to check if the wallet connection is still valid (maybe from some information that 
/hookAPI provided). - In 
/hookAPI, the wallet provider tells FCL how long the connection will be valid for. 
I’d prefer 2 or 3. They will also work for other future requests to the wallet service other than the signature request.
Issue Analytics
- State:
 - Created 3 years ago
 - Comments:7 (7 by maintainers)
 
Top Results From Across the Web
FCL: Check if user's wallet connection is still valid ... - GitHub
When dApp calls the signing function from fcl.currentUser().authorization , FCL creates a POST request to initiate the authorization process.
Read more >Flow Client Library (FCL) API Reference - Flow Developers
A convenience method that produces the needed authorization details for the current user to submit transactions to Flow. It defines a signing ...
Read more >Request for best practices re: wallet / account creation server ...
I'm looking to determine the best practice for creating flow accounts for users server side. The backend of my app is built in...
Read more >@onflow/fcl - npm
Authentication -- Authenticate Users using FCL wallet providers. ... This guide uses create-react-app and does not require any server-side ...
Read more >@onflow/sdk | Yarn - Package Manager
To solve this, we created a wallet discovery service that can be configured and accessed through FCL to display all available Flow wallet...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@boczeratul I like the idea of doing it silently, treating it as if we know roughly who they are, but not how to do things on their behalf.
@boczeratul what do you think about this:
fcl.unauthenticate()fcl.unauthenticate()right before a point that requires an authentication?@boczeratul I believe we are correctly respecting the expire value you are sending us, which I think solves this issue. Going to close this, if you find any issues with it let us know and I can re-open.