diff --git a/.changeset/funny-cups-count.md b/.changeset/funny-cups-count.md new file mode 100644 index 0000000000..19dbc3b8bf --- /dev/null +++ b/.changeset/funny-cups-count.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-gcalendar': patch +--- + +Pass user info email scope on auth refresh to resolve invalid credentials error diff --git a/plugins/gcalendar/src/hooks/useSignIn.ts b/plugins/gcalendar/src/hooks/useSignIn.ts index 351707b54e..3dbc778cf1 100644 --- a/plugins/gcalendar/src/hooks/useSignIn.ts +++ b/plugins/gcalendar/src/hooks/useSignIn.ts @@ -25,7 +25,10 @@ export const useSignIn = () => { const signIn = useCallback( async (optional = false) => { const token = await authApi.getAccessToken( - 'https://www.googleapis.com/auth/calendar.readonly', + [ + 'https://www.googleapis.com/auth/calendar.readonly', + 'https://www.googleapis.com/auth/userinfo.email', + ], { optional, instantPopup: !optional,