`RefreshToken()` does not refresh if the session is expired
Bug report
Describe the bug
It appears the the RefreshToken() function will not refresh the current token if it has expired. You can see here that it explicitly throws an error if it is expired. How is this proper behavior? Doesn't this behavior defeat the purpose of the refresh token, to be able to refresh the access token if it has already expired? Or is there something I am not understanding with how to use this API?
https://github.com/supabase-community/gotrue-csharp/blob/4c5f21981ed206a27a0367a363c9e2984b59f228/Gotrue/Client.cs#L715-L716
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Call RefreshToken() when CurrentSession is expired.
Expected behavior
I would expect the current token to be refreshed even if the current token is expired.
Screenshots
If applicable, add screenshots to help explain your problem.
System information
- OS: [e.g. macOS, Windows]
- Browser (if applies) [e.g. chrome, safari]
- Version of supabase-js: [e.g. 6.0.2]
- Version of Node.js: [e.g. 10.10.0]
Additional context
Add any other context about the problem here.
Ah, looks like there is already a PR out for this #109