Hi I just have Google Auth activated as a means of authenticating, how can I get the e-mail?
import type { GenerateCheckoutSession, GetCustomerPortalUrl } from 'wasp/server/operations'; import type { FetchCustomerPortalUrlArgs } from './paymentProcessor'; import { PaymentPlanId, paymentPlans } from '../payment/plans'; import { paymentProcessor } from './paymentProcessor'; import { HttpError } from 'wasp/server';
export const generateCheckoutSession: GenerateCheckoutSession<PaymentPlanId, CheckoutSession> = async ( paymentPlanId, context ) => { if (!context.user) { throw new HttpError(401); } const userId = context.user.id; const userEmail = context.user.email; if (!userEmail) { throw new HttpError( 403, 'User needs an email to make a payment. If using the usernameAndPassword Auth method, switch to an Auth method that provides an email.' ); }