From b5f2e3298568e2f2fcbee3ea3afdaa38fc7cebb6 Mon Sep 17 00:00:00 2001 From: David Morgan Date: Sat, 28 May 2022 22:28:14 +0100 Subject: [PATCH 1/3] Add pluginName param to useGoogleLogin --- src/use-google-login.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/use-google-login.js b/src/use-google-login.js index 5c0089a..93ba254 100644 --- a/src/use-google-login.js +++ b/src/use-google-login.js @@ -22,7 +22,8 @@ const useGoogleLogin = ({ accessType, responseType, jsSrc = 'https://apis.google.com/js/api.js', - prompt + prompt, + pluginName }) => { const [loaded, setLoaded] = useState(false) @@ -90,7 +91,8 @@ const useGoogleLogin = ({ ux_mode: uxMode, redirect_uri: redirectUri, scope, - access_type: accessType + access_type: accessType, + plugin_name: pluginName } if (responseType === 'code') { From e21f6997b72be5e0b09ad655f128283105378bc7 Mon Sep 17 00:00:00 2001 From: David Morgan Date: Sat, 28 May 2022 22:28:55 +0100 Subject: [PATCH 2/3] Add pluginName prop to GoogleLogin --- src/google-login.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/google-login.js b/src/google-login.js index 09e17f0..f715ddb 100755 --- a/src/google-login.js +++ b/src/google-login.js @@ -37,7 +37,8 @@ const GoogleLogin = props => { accessType, responseType, jsSrc, - prompt + prompt, + pluginName } = props const { signIn, loaded } = useGoogleLogin({ @@ -60,7 +61,8 @@ const GoogleLogin = props => { accessType, responseType, jsSrc, - prompt + prompt, + pluginName }) const disabled = disabledProp || !loaded @@ -169,7 +171,8 @@ GoogleLogin.propTypes = { accessType: PropTypes.string, render: PropTypes.func, theme: PropTypes.string, - icon: PropTypes.bool + icon: PropTypes.bool, + pluginName: PropTypes.string } GoogleLogin.defaultProps = { From 409636e4cc8856bd4031f62bc72b8d6538005373 Mon Sep 17 00:00:00 2001 From: David Morgan Date: Fri, 11 Nov 2022 01:15:07 +0000 Subject: [PATCH 3/3] Update README with pluginName parameter --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d5fafb8..bc8d187 100644 --- a/README.md +++ b/README.md @@ -86,7 +86,8 @@ const { signIn, loaded } = useGoogleLogin({ responseType, jsSrc, onRequest, - prompt + prompt, + pluginName }) ``` ## Logout Hook @@ -168,6 +169,7 @@ Use GoogleLogout button to logout the user from google. | redirectUri | string | - | If using ux_mode='redirect', this parameter allows you to override the default redirect_uri that will be used at the end of the consent flow. The default redirect_uri is the current URL stripped of query parameters and hash fragment. | | isSignedIn | boolean | false | If true will return GoogleUser object on load, if user has given your app permission | | render | function | - | Render prop to use a custom element, use renderProps.onClick | +| pluginName | string | - | Enables legacy use for new client IDs created before July 29th 2022, as described here (https://developers.google.com/identity/sign-in/web/reference) | Google Scopes List: [scopes](https://developers.google.com/identity/protocols/googlescopes) ## Logout Props