123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- 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;
|