Скажите, что я использую эту стратегию (https://www.keystonejs.com/guides/authentication) для аутентификации:
type: GoogleAuthStrategy,
list: 'User',
config: {
idField: 'googleId',
appId: '<Your Google App Id>',
appSecret: '<Your Google App Secret>',
loginPath: '/auth/google',
callbackPath: '/auth/google/callback',
// Once a user is found/created and successfully matched to the
// googleId, they are authenticated, and the token is returned here.
// NOTE: By default KeystoneJS sets a `keystone.sid` which authenticates the
// user for the API domain. If you want to authenticate via another domain,
// you must pass the `token` as a Bearer Token to GraphQL requests.
onAuthenticated: ({ token, item, isNewItem }, req, res) => {
console.log(token);
res.redirect('/');
},
// If there was an error during any of the authentication flow, this
// callback is executed
onError: (error, req, res) => {
console.error(error);
res.redirect('/?error=Uh-oh');
},
},
});
Как мне получить имя и адрес электронной почты профиля? Пока что я могу получить только идентификатор. Я знаю, как сделать это с помощью автономного пакета google-passport с обратным вызовом «profile», но мне нужно сделать это с помощью keystone / auth-passport. Есть ли эквивалент обратного вызова профиля или какие-то другие способы выполнения sh этого?