import Vue from 'vue'; import axios from "axios"; import UniversalSocialAuth from "universal-social-auth"; const defaultOptions = { redirectUri: window.location.origin, oauthType: "2.0", responseType: "code", optionalUrlParams: ["display", "scope"], usePopup: true, display: "popup", state: true, popupOptions: { width: 500, height: 500 }, } const options = { providers: { vk: { name: "vk", clientId: '6199950', authorizationEndpoint: "https://oauth.vk.com/authorize", scope: 'email', ...defaultOptions }, ok: { name: "ok", clientId: '1255143936', authorizationEndpoint: "https://connect.ok.ru/oauth/authorize", scope: 'VALUABLE_ACCESS,GET_EMAIL', ...defaultOptions }, fb: { name: "fb", clientId: '421123926237121', authorizationEndpoint: "https://www.facebook.com/v12.0/dialog/oauth", scope: 'public_profile,email', ...defaultOptions }, } }; const oauth = new UniversalSocialAuth(axios, options); Vue.prototype.$oauth = oauth;