Closed iAmWillShepherd closed 2 years ago
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/onesignaldevs/ngosi/Ej1CaLYhrDiLcNprkX18vEyzx6Hv
✅ Preview: https://ngosi-git-auth-provider-onesignaldevs.vercel.app
Fixes #46.
Solution
I refactored the
useSupbaseHook
to be back by React context. I also pulled all the logic originally in the hook into a new functional component that will act as a provider to the app. I originally thought this would prevent the app flashing while it computes the auth state, but this is not the case, so I may need to work with someone who's stronger in React to address the issue (see #48).Testing
These changes don't result in a change in behavior, but instead, reactors the
useSupabase
hook to implement the provider pattern. The test for these changes is effectively verifying that it works the same as before.dev
branchgit checkout auth-provider
Resources
References