( auth: Auth, providerId: string )
| 95 | }; |
| 96 | |
| 97 | const useSignInWithOAuth = ( |
| 98 | auth: Auth, |
| 99 | providerId: string |
| 100 | ): SignInWithPopupHook => { |
| 101 | const createOAuthProvider = useCallback( |
| 102 | (scopes?: string[], customOAuthParameters?: CustomParameters) => { |
| 103 | const provider = new OAuthProvider(providerId); |
| 104 | if (scopes) { |
| 105 | scopes.forEach((scope) => provider.addScope(scope)); |
| 106 | } |
| 107 | if (customOAuthParameters) { |
| 108 | provider.setCustomParameters(customOAuthParameters); |
| 109 | } |
| 110 | return provider; |
| 111 | }, |
| 112 | [providerId] |
| 113 | ); |
| 114 | return useSignInWithPopup(auth, createOAuthProvider); |
| 115 | }; |
| 116 | |
| 117 | const useSignInWithPopup = ( |
| 118 | auth: Auth, |
no test coverage detected