UNPKG

@denz93/vendure-plugin-3rd-party-auth

Version:

A set of auth strategies to work with 3rd party such as Google, Facebook, etc

25 lines (24 loc) 871 B
import { HttpService } from "@nestjs/common"; import { FacebookUserInfo, IThirdPartyAuthPluginOptions } from "./interfaces"; export declare class FacebookAuthService { private httpService; private options; private endpoint; private version; private optionDetail; constructor(httpService: HttpService, options: Required<IThirdPartyAuthPluginOptions>); /** * The flow to verify a token will be: * * 1. Generate app_token using client_id, and client_secret * 2. Inspect the token below using app_token * 3. Call /me endpoint on behalf of user to get user's email * * @param token the token is retrieved from Facebook dialog in front-end */ verify(token: string): Promise<FacebookUserInfo>; private getUserInfo; private inspectToken; private generateAppToken; private constructUrl; }