UNPKG

@ecomplus/passport-client

Version:

Handle customer authentication with E-Com Plus Passport

25 lines (20 loc) 507 B
import { passport } from '@ecomplus/client' /** * @method * @name EcomPassport#fetchOauthProfile * @description Try get session and account data after social login. * * @returns {Promise<session|error>} * * @example ecomPassport.fetchOauthProfile().then(() => { console.log(ecomPassport.checkVerification() === true) }) */ export default ({ storeId, sessionId, setSession }) => passport({ url: `${sessionId}/token.json`, storeId }).then(({ data }) => { setSession(data) return data })