()
| 3 | import Script from 'next/script'; |
| 4 | |
| 5 | export default function GoogleSignInScript() { |
| 6 | const { isAuthenticated, loading } = useAuth(); |
| 7 | |
| 8 | // Wait until we're done loading; if authenticated, do not render the script. |
| 9 | if (loading || isAuthenticated) { |
| 10 | return null; |
| 11 | } |
| 12 | |
| 13 | return ( |
| 14 | <Script |
| 15 | src="https://accounts.google.com/gsi/client" |
| 16 | strategy="afterInteractive" |
| 17 | /> |
| 18 | ); |
| 19 | } |