supabase / gotrue-dart

A dart client library for GoTrue.
MIT License
46 stars 37 forks source link

fix: use completer in the retry logic to return value when token refresh is complete #75

Closed dshukertjr closed 2 years ago

dshukertjr commented 2 years ago

This PR is a rework of https://github.com/supabase-community/gotrue-dart/pull/71 pretty much.

Instead of just retrying token refresh every 5 seconds, this PR will use a Completer to return a valid GoTrueSessionResponse upon successful token refresh after retry.

dshukertjr commented 2 years ago

Haven't written tests for it, but am currently working on it. Also still working on some refactoring.