UNPKG

@paroicms/server

Version:
25 lines 774 B
import { platformLogger } from "../context.js"; export async function validateOAuthLogin(googleAccount) { try { const email = googleAccount._json.email; const emailVerified = googleAccount._json.email_verified; if (!email || emailVerified !== true) { platformLogger.error("Missing user email use scope:['email'] to retrieve email from google auth api"); return { message: "Unauthorized", statusCode: 401, }; } return { email, }; } catch (error) { platformLogger.error(error); return { message: "Unauthorized", statusCode: 401, }; } } //# sourceMappingURL=account-auth.service.js.map