Skip to content

Instantly share code, notes, and snippets.

@vgrafe
Created September 23, 2021 19:40
Show Gist options
  • Save vgrafe/13f20faae6821750521f498f09e05253 to your computer and use it in GitHub Desktop.
Save vgrafe/13f20faae6821750521f498f09e05253 to your computer and use it in GitHub Desktop.
adam-next
import useSession from next-auth
import useState from react
const usePlaidSession = () => {
const [linked, setLinked] = useState(false);
const [session, loading] = useSession();
const isLinked = linked || session.linked;
return {session, isLinked, loading, setLinked}
}
// in your app, you call usePlaidSession to get the state
// in the plaid button, you call usePlaidSession's setLinked(true) after sucesful link action
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment