@tapni/auth 1.0.6 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.vite/manifest.json +18 -25
- package/dist/{Apps-CQsB1lEC.js → Apps-aanvwc1E.js} +1 -1
- package/dist/{Billing-BIO99qab.js → Billing-C7LjeXBV.js} +1 -1
- package/dist/{CustomApp-CQ4RAku_.js → CustomApp-Cd00FwXJ.js} +1 -1
- package/dist/{General-iSouoUZJ.js → General-DH-AnLIA.js} +1 -1
- package/dist/{QR-CCoQyrlf.js → QR-cfWsMTIZ.js} +1 -1
- package/dist/TapniAuth.es.js +1 -1
- package/dist/TapniAuth.umd.js +15 -15
- package/dist/{install-DBU_KAIr.js → install-CBFqB-tX.js} +2333 -2422
- package/dist/{web-IFGkBi0t.js → web-UrTMimK1.js} +2 -2
- package/dist/web-XbruGdlD.js +121 -0
- package/package.json +3 -4
- package/src/services/AuthService.js +0 -8
- package/src/views/Login.vue +1 -23
- package/src/views/Register.vue +1 -11
- package/dist/web-AXRKjAOB.js +0 -92
- package/dist/web-BhPSya4n.js +0 -124
- package/src/mixins/facebook.mixin.js +0 -78
- /package/dist/{auth.css → style.css} +0 -0
|
@@ -21,13 +21,13 @@ class g extends c {
|
|
|
21
21
|
if (typeof window > "u")
|
|
22
22
|
return;
|
|
23
23
|
const t = (s = document.getElementsByName("google-signin-client_id")[0]) === null || s === void 0 ? void 0 : s.content, i = e.clientId || t || "";
|
|
24
|
-
i || console.warn("GoogleAuthPlugin - clientId is empty"), this.options = {
|
|
24
|
+
return i || console.warn("GoogleAuthPlugin - clientId is empty"), this.options = {
|
|
25
25
|
clientId: i,
|
|
26
26
|
grantOfflineAccess: (n = e.grantOfflineAccess) !== null && n !== void 0 ? n : !1,
|
|
27
27
|
scopes: e.scopes || []
|
|
28
28
|
}, this.gapiLoaded = new Promise((o) => {
|
|
29
29
|
window.gapiResolve = o, this.loadScript();
|
|
30
|
-
}), this.addUserChangeListener();
|
|
30
|
+
}), this.addUserChangeListener(), this.gapiLoaded;
|
|
31
31
|
}
|
|
32
32
|
platformJsLoaded() {
|
|
33
33
|
gapi.load("auth2", () => {
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { WebPlugin as j } from "@capacitor/core";
|
|
2
|
+
var w = { exports: {} };
|
|
3
|
+
/*!
|
|
4
|
+
* $script.js JS loader & dependency manager
|
|
5
|
+
* https://github.com/ded/script.js
|
|
6
|
+
* (c) Dustin Diaz 2014 | License MIT
|
|
7
|
+
*/
|
|
8
|
+
(function(y) {
|
|
9
|
+
(function(i, p) {
|
|
10
|
+
y.exports ? y.exports = p() : this[i] = p();
|
|
11
|
+
})("$script", function() {
|
|
12
|
+
var i = document, p = i.getElementsByTagName("head")[0], I = !1, m = "push", S = "readyState", A = "onreadystatechange", s = {}, o = {}, d = {}, f, v;
|
|
13
|
+
function g(e, t) {
|
|
14
|
+
for (var n = 0, u = e.length; n < u; ++n) if (!t(e[n])) return I;
|
|
15
|
+
return 1;
|
|
16
|
+
}
|
|
17
|
+
function h(e, t) {
|
|
18
|
+
g(e, function(n) {
|
|
19
|
+
return t(n), 1;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function l(e, t, n) {
|
|
23
|
+
e = e[m] ? e : [e];
|
|
24
|
+
var u = t && t.call, r = u ? t : n, N = u ? e.join("") : t, U = e.length;
|
|
25
|
+
function b(c) {
|
|
26
|
+
return c.call ? c() : s[c];
|
|
27
|
+
}
|
|
28
|
+
function _() {
|
|
29
|
+
if (!--U) {
|
|
30
|
+
s[N] = 1, r && r();
|
|
31
|
+
for (var c in o)
|
|
32
|
+
g(c.split("|"), b) && !h(o[c], b) && (o[c] = []);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return setTimeout(function() {
|
|
36
|
+
h(e, function c(a, W) {
|
|
37
|
+
if (a === null) return _();
|
|
38
|
+
if (!W && !/^https?:\/\//.test(a) && f && (a = a.indexOf(".js") === -1 ? f + a + ".js" : f + a), d[a])
|
|
39
|
+
return d[a] == 2 ? _() : setTimeout(function() {
|
|
40
|
+
c(a, !0);
|
|
41
|
+
}, 0);
|
|
42
|
+
d[a] = 1, x(a, _);
|
|
43
|
+
});
|
|
44
|
+
}, 0), l;
|
|
45
|
+
}
|
|
46
|
+
function x(e, t) {
|
|
47
|
+
var n = i.createElement("script"), u;
|
|
48
|
+
n.onload = n.onerror = n[A] = function() {
|
|
49
|
+
n[S] && !/^c|loade/.test(n[S]) || u || (n.onload = n[A] = null, u = 1, d[e] = 2, t());
|
|
50
|
+
}, n.async = 1, n.src = v ? e + (e.indexOf("?") === -1 ? "?" : "&") + v : e, p.insertBefore(n, p.lastChild);
|
|
51
|
+
}
|
|
52
|
+
return l.get = x, l.order = function(e, t, n) {
|
|
53
|
+
(function u(r) {
|
|
54
|
+
r = e.shift(), e.length ? l(r, u) : l(r, t, n);
|
|
55
|
+
})();
|
|
56
|
+
}, l.path = function(e) {
|
|
57
|
+
f = e;
|
|
58
|
+
}, l.urlArgs = function(e) {
|
|
59
|
+
v = e;
|
|
60
|
+
}, l.ready = function(e, t, n) {
|
|
61
|
+
e = e[m] ? e : [e];
|
|
62
|
+
var u = [];
|
|
63
|
+
return !h(e, function(r) {
|
|
64
|
+
s[r] || u[m](r);
|
|
65
|
+
}) && g(e, function(r) {
|
|
66
|
+
return s[r];
|
|
67
|
+
}) ? t() : function(r) {
|
|
68
|
+
o[r] = o[r] || [], o[r][m](t), n && n(u);
|
|
69
|
+
}(e.join("|")), l;
|
|
70
|
+
}, l.done = function(e) {
|
|
71
|
+
l([null], e);
|
|
72
|
+
}, l;
|
|
73
|
+
});
|
|
74
|
+
})(w);
|
|
75
|
+
var z = w.exports;
|
|
76
|
+
class P extends j {
|
|
77
|
+
constructor() {
|
|
78
|
+
super({
|
|
79
|
+
name: "SignInWithApple",
|
|
80
|
+
platforms: ["web"]
|
|
81
|
+
}), this.appleScriptUrl = "https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js", this.isAppleScriptLoaded = !1;
|
|
82
|
+
}
|
|
83
|
+
async authorize(i) {
|
|
84
|
+
return new Promise((p, I) => {
|
|
85
|
+
i ? this.loadSignInWithAppleJS().then((m) => {
|
|
86
|
+
var S, A, s;
|
|
87
|
+
this.isAppleScriptLoaded = m, this.isAppleScriptLoaded ? (AppleID.auth.init({
|
|
88
|
+
clientId: i.clientId,
|
|
89
|
+
redirectURI: i.redirectURI,
|
|
90
|
+
scope: (S = i.scopes) !== null && S !== void 0 ? S : void 0,
|
|
91
|
+
state: (A = i.state) !== null && A !== void 0 ? A : void 0,
|
|
92
|
+
nonce: (s = i.nonce) !== null && s !== void 0 ? s : void 0,
|
|
93
|
+
usePopup: !0
|
|
94
|
+
}), AppleID.auth.signIn().then((o) => {
|
|
95
|
+
var d, f, v, g, h;
|
|
96
|
+
const l = {
|
|
97
|
+
response: {
|
|
98
|
+
user: null,
|
|
99
|
+
email: (d = o.user) === null || d === void 0 ? void 0 : d.email,
|
|
100
|
+
givenName: (v = (f = o.user) === null || f === void 0 ? void 0 : f.name) === null || v === void 0 ? void 0 : v.firstName,
|
|
101
|
+
familyName: (h = (g = o.user) === null || g === void 0 ? void 0 : g.name) === null || h === void 0 ? void 0 : h.lastName,
|
|
102
|
+
identityToken: o.authorization.id_token,
|
|
103
|
+
authorizationCode: o.authorization.code
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
p(l);
|
|
107
|
+
}).catch((o) => {
|
|
108
|
+
I(o);
|
|
109
|
+
})) : I("Unable to load Sign in with Apple JS framework.");
|
|
110
|
+
}) : I("No options were provided.");
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
loadSignInWithAppleJS() {
|
|
114
|
+
return new Promise((i) => {
|
|
115
|
+
this.isAppleScriptLoaded ? i(!0) : typeof window !== void 0 ? z.get(this.appleScriptUrl, () => i(!0)) : i(!1);
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
P as SignInWithAppleWeb
|
|
121
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tapni/auth",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/TapniAuth.umd.js",
|
|
6
6
|
"module": "./dist/TapniAuth.es.js",
|
|
@@ -24,13 +24,12 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@braintree/sanitize-url": "^7.1.0",
|
|
26
26
|
"@capacitor-community/apple-sign-in": "^6.0.0",
|
|
27
|
-
"@capacitor-community/facebook-login": "^6.0.0",
|
|
28
27
|
"@capacitor/app": "^6.0.2",
|
|
29
28
|
"@capacitor/browser": "^6.0.4",
|
|
30
29
|
"@capacitor/core": "^6.2.0",
|
|
31
30
|
"@capacitor/device": "^6.0.2",
|
|
32
31
|
"@capacitor/preferences": "^6.0.3",
|
|
33
|
-
"@codetrix-studio/capacitor-google-auth": "^3.
|
|
32
|
+
"@codetrix-studio/capacitor-google-auth": "^3.4.0-rc.4",
|
|
34
33
|
"@otplib/preset-browser": "^12.0.1",
|
|
35
34
|
"@recognizebv/capacitor-plugin-msauth": "^3.6.1",
|
|
36
35
|
"@tapni/capacitor-reactive-localstorage-vue3": "^0.0.17",
|
|
@@ -51,7 +50,7 @@
|
|
|
51
50
|
"@rollup/plugin-inject": "^5.0.5",
|
|
52
51
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
53
52
|
"office-addin-dev-certs": "^1.13.5",
|
|
54
|
-
"vite": "^
|
|
53
|
+
"vite": "^5.4.11",
|
|
55
54
|
"vite-plugin-node-polyfills": "^0.22.0"
|
|
56
55
|
}
|
|
57
56
|
}
|
|
@@ -42,18 +42,10 @@ export default {
|
|
|
42
42
|
data.device_id = deviceID
|
|
43
43
|
return api().post('/users/google', data)
|
|
44
44
|
},
|
|
45
|
-
facebook (data) {
|
|
46
|
-
data.device_id = deviceID
|
|
47
|
-
return api().post('/users/facebook', data)
|
|
48
|
-
},
|
|
49
45
|
googleSDK (data) {
|
|
50
46
|
data.device_id = deviceID
|
|
51
47
|
return api().post('/users/google/sdk', data)
|
|
52
48
|
},
|
|
53
|
-
facebookSDK (data) {
|
|
54
|
-
data.device_id = deviceID
|
|
55
|
-
return api().post('/users/facebook/sdk', data)
|
|
56
|
-
},
|
|
57
49
|
appleSDK (data) {
|
|
58
50
|
data.device_id = deviceID
|
|
59
51
|
return api().post('/users/apple/sdk', data)
|
package/src/views/Login.vue
CHANGED
|
@@ -152,27 +152,6 @@
|
|
|
152
152
|
<span v-else class="button--loading-black button__loader"></span>
|
|
153
153
|
</a>
|
|
154
154
|
|
|
155
|
-
<!-- Facebook Login Button -->
|
|
156
|
-
<a
|
|
157
|
-
@click="facebookLogin"
|
|
158
|
-
v-if="displayFacebookLogin"
|
|
159
|
-
class="button-center button button-90 google-button pointer"
|
|
160
|
-
>
|
|
161
|
-
<img
|
|
162
|
-
src="https://cdn.tapni.co/icons/facebook-blue.png"
|
|
163
|
-
style="
|
|
164
|
-
position: absolute;
|
|
165
|
-
margin-left: -9px;
|
|
166
|
-
padding: 10px 0;
|
|
167
|
-
height: 100%;
|
|
168
|
-
"
|
|
169
|
-
/>
|
|
170
|
-
<span v-if="!facebookLoad"
|
|
171
|
-
>{{ ssoLang[appLanguage].sign_in_with }} Facebook</span
|
|
172
|
-
>
|
|
173
|
-
<span v-else class="button--loading-black button__loader"></span>
|
|
174
|
-
</a>
|
|
175
|
-
|
|
176
155
|
<!-- Microsoft Login Button -->
|
|
177
156
|
<a
|
|
178
157
|
@click="microsoftLogin"
|
|
@@ -314,7 +293,6 @@
|
|
|
314
293
|
|
|
315
294
|
<script>
|
|
316
295
|
import GoogleMixin from "../mixins/google.mixin";
|
|
317
|
-
import FacebookMixin from "../mixins/facebook.mixin";
|
|
318
296
|
import AppleMixin from "../mixins/apple.mixin";
|
|
319
297
|
import MicrosoftMixin from "../mixins/microsoft.mixin";
|
|
320
298
|
import OktaMixin from "../mixins/okta.mixin";
|
|
@@ -325,7 +303,7 @@ import { EventBus } from "../store/event-bus";
|
|
|
325
303
|
import to from "await-to-js";
|
|
326
304
|
export default {
|
|
327
305
|
name: "AuthLogin",
|
|
328
|
-
mixins: [GoogleMixin,
|
|
306
|
+
mixins: [GoogleMixin, AppleMixin, MicrosoftMixin, OktaMixin, SamlMixin, AuthMixin, QRAuthMixin],
|
|
329
307
|
data() {
|
|
330
308
|
return {
|
|
331
309
|
loading: true,
|
package/src/views/Register.vue
CHANGED
|
@@ -66,15 +66,6 @@
|
|
|
66
66
|
<span v-else class="button--loading-black button__loader"></span>
|
|
67
67
|
</a>
|
|
68
68
|
|
|
69
|
-
<!-- Facebook Login Button -->
|
|
70
|
-
<a v-if="displayFacebookLogin"
|
|
71
|
-
@click="facebookLogin"
|
|
72
|
-
class="button-center button button-90 google-button pointer">
|
|
73
|
-
<img src="https://cdn.tapni.co/icons/facebook-blue.png" style="position: absolute; margin-left: -10px; padding: 10px 0; height: 100%;"/>
|
|
74
|
-
<span v-if="!facebookLoad">{{ssoLang[this.appLanguage].sign_up_with}} Facebook</span>
|
|
75
|
-
<span v-else class="button--loading-black button__loader"></span>
|
|
76
|
-
</a>
|
|
77
|
-
|
|
78
69
|
<!-- Email Login Button -->
|
|
79
70
|
<a @click="emailLogin = true" v-if="!emailLogin"
|
|
80
71
|
class="button-center button button-90 google-button pointer">
|
|
@@ -103,14 +94,13 @@
|
|
|
103
94
|
|
|
104
95
|
<script>
|
|
105
96
|
import GoogleMixin from '../mixins/google.mixin'
|
|
106
|
-
import FacebookMixin from '../mixins/facebook.mixin'
|
|
107
97
|
import AppleMixin from '../mixins/apple.mixin'
|
|
108
98
|
import MicrosoftMixin from '../mixins/microsoft.mixin'
|
|
109
99
|
import {EventBus} from "../store/event-bus";
|
|
110
100
|
import AuthMixin from "../mixins/auth.mixin";
|
|
111
101
|
export default {
|
|
112
102
|
name: 'AuthRegister',
|
|
113
|
-
mixins: [GoogleMixin,
|
|
103
|
+
mixins: [GoogleMixin, AppleMixin, MicrosoftMixin, AuthMixin],
|
|
114
104
|
props: {
|
|
115
105
|
isModal: {
|
|
116
106
|
type: Boolean,
|
package/dist/web-AXRKjAOB.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
import { WebPlugin as i } from "@capacitor/core";
|
|
2
|
-
class u extends i {
|
|
3
|
-
async initialize(e) {
|
|
4
|
-
const n = { version: "v17.0" };
|
|
5
|
-
return await this.loadScript(e.locale), FB.init(Object.assign(Object.assign({}, n), e));
|
|
6
|
-
}
|
|
7
|
-
loadScript(e) {
|
|
8
|
-
if (typeof document > "u")
|
|
9
|
-
return Promise.reject("document global not found");
|
|
10
|
-
const n = "fb";
|
|
11
|
-
if (document.getElementById(n))
|
|
12
|
-
return Promise.resolve();
|
|
13
|
-
const r = document.getElementsByTagName("head")[0], s = document.createElement("script");
|
|
14
|
-
return new Promise((o) => {
|
|
15
|
-
s.onload = () => o(), s.defer = !0, s.async = !0, s.id = n, s.src = `https://connect.facebook.net/${e ?? "en_US"}/sdk.js`, r.appendChild(s);
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
async login(e) {
|
|
19
|
-
return new Promise((n, t) => {
|
|
20
|
-
FB.login((r) => {
|
|
21
|
-
r.status === "connected" ? n({
|
|
22
|
-
accessToken: {
|
|
23
|
-
token: r.authResponse.accessToken
|
|
24
|
-
}
|
|
25
|
-
}) : t({
|
|
26
|
-
accessToken: {
|
|
27
|
-
token: null
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
}, { scope: e.permissions.join(",") });
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
async logout() {
|
|
34
|
-
return new Promise((e) => FB.logout(() => e()));
|
|
35
|
-
}
|
|
36
|
-
async reauthorize() {
|
|
37
|
-
return new Promise((e) => FB.reauthorize((n) => e(n)));
|
|
38
|
-
}
|
|
39
|
-
async getCurrentAccessToken() {
|
|
40
|
-
return new Promise((e, n) => {
|
|
41
|
-
FB.getLoginStatus((t) => {
|
|
42
|
-
if (t.status === "connected") {
|
|
43
|
-
const r = {
|
|
44
|
-
accessToken: {
|
|
45
|
-
applicationId: void 0,
|
|
46
|
-
declinedPermissions: [],
|
|
47
|
-
expires: void 0,
|
|
48
|
-
isExpired: void 0,
|
|
49
|
-
lastRefresh: void 0,
|
|
50
|
-
permissions: [],
|
|
51
|
-
token: t.authResponse.accessToken,
|
|
52
|
-
userId: t.authResponse.userID
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
e(r);
|
|
56
|
-
} else
|
|
57
|
-
n({
|
|
58
|
-
accessToken: {
|
|
59
|
-
token: null
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
async getProfile(e) {
|
|
66
|
-
const n = e.fields.join(",");
|
|
67
|
-
return new Promise((t, r) => {
|
|
68
|
-
FB.api("/me", { fields: n }, (s) => {
|
|
69
|
-
if (s.error) {
|
|
70
|
-
r(s.error.message);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
t(s);
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
async logEvent() {
|
|
78
|
-
return Promise.resolve();
|
|
79
|
-
}
|
|
80
|
-
async setAutoLogAppEventsEnabled() {
|
|
81
|
-
return Promise.resolve();
|
|
82
|
-
}
|
|
83
|
-
async setAdvertiserTrackingEnabled() {
|
|
84
|
-
return Promise.resolve();
|
|
85
|
-
}
|
|
86
|
-
async setAdvertiserIDCollectionEnabled() {
|
|
87
|
-
return Promise.resolve();
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
export {
|
|
91
|
-
u as FacebookLoginWeb
|
|
92
|
-
};
|
package/dist/web-BhPSya4n.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { WebPlugin as z } from "@capacitor/core";
|
|
2
|
-
var _ = { exports: {} };
|
|
3
|
-
/*!
|
|
4
|
-
* $script.js JS loader & dependency manager
|
|
5
|
-
* https://github.com/ded/script.js
|
|
6
|
-
* (c) Dustin Diaz 2014 | License MIT
|
|
7
|
-
*/
|
|
8
|
-
var N;
|
|
9
|
-
function L() {
|
|
10
|
-
return N || (N = 1, function(x) {
|
|
11
|
-
(function(i, p) {
|
|
12
|
-
x.exports ? x.exports = p() : this[i] = p();
|
|
13
|
-
})("$script", function() {
|
|
14
|
-
var i = document, p = i.getElementsByTagName("head")[0], I = !1, m = "push", S = "readyState", A = "onreadystatechange", s = {}, o = {}, d = {}, f, v;
|
|
15
|
-
function h(e, t) {
|
|
16
|
-
for (var n = 0, u = e.length; n < u; ++n) if (!t(e[n])) return I;
|
|
17
|
-
return 1;
|
|
18
|
-
}
|
|
19
|
-
function g(e, t) {
|
|
20
|
-
h(e, function(n) {
|
|
21
|
-
return t(n), 1;
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
function l(e, t, n) {
|
|
25
|
-
e = e[m] ? e : [e];
|
|
26
|
-
var u = t && t.call, r = u ? t : n, U = u ? e.join("") : t, W = e.length;
|
|
27
|
-
function w(c) {
|
|
28
|
-
return c.call ? c() : s[c];
|
|
29
|
-
}
|
|
30
|
-
function y() {
|
|
31
|
-
if (!--W) {
|
|
32
|
-
s[U] = 1, r && r();
|
|
33
|
-
for (var c in o)
|
|
34
|
-
h(c.split("|"), w) && !g(o[c], w) && (o[c] = []);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
return setTimeout(function() {
|
|
38
|
-
g(e, function c(a, j) {
|
|
39
|
-
if (a === null) return y();
|
|
40
|
-
if (!j && !/^https?:\/\//.test(a) && f && (a = a.indexOf(".js") === -1 ? f + a + ".js" : f + a), d[a])
|
|
41
|
-
return d[a] == 2 ? y() : setTimeout(function() {
|
|
42
|
-
c(a, !0);
|
|
43
|
-
}, 0);
|
|
44
|
-
d[a] = 1, b(a, y);
|
|
45
|
-
});
|
|
46
|
-
}, 0), l;
|
|
47
|
-
}
|
|
48
|
-
function b(e, t) {
|
|
49
|
-
var n = i.createElement("script"), u;
|
|
50
|
-
n.onload = n.onerror = n[A] = function() {
|
|
51
|
-
n[S] && !/^c|loade/.test(n[S]) || u || (n.onload = n[A] = null, u = 1, d[e] = 2, t());
|
|
52
|
-
}, n.async = 1, n.src = v ? e + (e.indexOf("?") === -1 ? "?" : "&") + v : e, p.insertBefore(n, p.lastChild);
|
|
53
|
-
}
|
|
54
|
-
return l.get = b, l.order = function(e, t, n) {
|
|
55
|
-
(function u(r) {
|
|
56
|
-
r = e.shift(), e.length ? l(r, u) : l(r, t, n);
|
|
57
|
-
})();
|
|
58
|
-
}, l.path = function(e) {
|
|
59
|
-
f = e;
|
|
60
|
-
}, l.urlArgs = function(e) {
|
|
61
|
-
v = e;
|
|
62
|
-
}, l.ready = function(e, t, n) {
|
|
63
|
-
e = e[m] ? e : [e];
|
|
64
|
-
var u = [];
|
|
65
|
-
return !g(e, function(r) {
|
|
66
|
-
s[r] || u[m](r);
|
|
67
|
-
}) && h(e, function(r) {
|
|
68
|
-
return s[r];
|
|
69
|
-
}) ? t() : function(r) {
|
|
70
|
-
o[r] = o[r] || [], o[r][m](t), n && n(u);
|
|
71
|
-
}(e.join("|")), l;
|
|
72
|
-
}, l.done = function(e) {
|
|
73
|
-
l([null], e);
|
|
74
|
-
}, l;
|
|
75
|
-
});
|
|
76
|
-
}(_)), _.exports;
|
|
77
|
-
}
|
|
78
|
-
var P = L();
|
|
79
|
-
class k extends z {
|
|
80
|
-
constructor() {
|
|
81
|
-
super({
|
|
82
|
-
name: "SignInWithApple",
|
|
83
|
-
platforms: ["web"]
|
|
84
|
-
}), this.appleScriptUrl = "https://appleid.cdn-apple.com/appleauth/static/jsapi/appleid/1/en_US/appleid.auth.js", this.isAppleScriptLoaded = !1;
|
|
85
|
-
}
|
|
86
|
-
async authorize(i) {
|
|
87
|
-
return new Promise((p, I) => {
|
|
88
|
-
i ? this.loadSignInWithAppleJS().then((m) => {
|
|
89
|
-
var S, A, s;
|
|
90
|
-
this.isAppleScriptLoaded = m, this.isAppleScriptLoaded ? (AppleID.auth.init({
|
|
91
|
-
clientId: i.clientId,
|
|
92
|
-
redirectURI: i.redirectURI,
|
|
93
|
-
scope: (S = i.scopes) !== null && S !== void 0 ? S : void 0,
|
|
94
|
-
state: (A = i.state) !== null && A !== void 0 ? A : void 0,
|
|
95
|
-
nonce: (s = i.nonce) !== null && s !== void 0 ? s : void 0,
|
|
96
|
-
usePopup: !0
|
|
97
|
-
}), AppleID.auth.signIn().then((o) => {
|
|
98
|
-
var d, f, v, h, g;
|
|
99
|
-
const l = {
|
|
100
|
-
response: {
|
|
101
|
-
user: null,
|
|
102
|
-
email: (d = o.user) === null || d === void 0 ? void 0 : d.email,
|
|
103
|
-
givenName: (v = (f = o.user) === null || f === void 0 ? void 0 : f.name) === null || v === void 0 ? void 0 : v.firstName,
|
|
104
|
-
familyName: (g = (h = o.user) === null || h === void 0 ? void 0 : h.name) === null || g === void 0 ? void 0 : g.lastName,
|
|
105
|
-
identityToken: o.authorization.id_token,
|
|
106
|
-
authorizationCode: o.authorization.code
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
p(l);
|
|
110
|
-
}).catch((o) => {
|
|
111
|
-
I(o);
|
|
112
|
-
})) : I("Unable to load Sign in with Apple JS framework.");
|
|
113
|
-
}) : I("No options were provided.");
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
loadSignInWithAppleJS() {
|
|
117
|
-
return new Promise((i) => {
|
|
118
|
-
this.isAppleScriptLoaded ? i(!0) : typeof window !== void 0 ? P.get(this.appleScriptUrl, () => i(!0)) : i(!1);
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
export {
|
|
123
|
-
k as SignInWithAppleWeb
|
|
124
|
-
};
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import to from 'await-to-js'
|
|
2
|
-
import AuthService from '../services/AuthService'
|
|
3
|
-
import { FacebookLogin } from '@capacitor-community/facebook-login';
|
|
4
|
-
import {EventBus} from "../store/event-bus";
|
|
5
|
-
|
|
6
|
-
window.fbAsyncInit = function () {
|
|
7
|
-
// eslint-disable-next-line no-undef
|
|
8
|
-
FB.init({
|
|
9
|
-
appId: '202577611527680',
|
|
10
|
-
cookie: true, // enable cookies to allow the server to access the session
|
|
11
|
-
xfbml: true, // parse social plugins on this page
|
|
12
|
-
version: 'v16.0' // use graph api current version
|
|
13
|
-
})
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
// Load the SDK asynchronously
|
|
17
|
-
(function (d, s, id) {
|
|
18
|
-
// eslint-disable-next-line one-var
|
|
19
|
-
var js, fjs = d.getElementsByTagName(s)[0]
|
|
20
|
-
if (d.getElementById(id)) return
|
|
21
|
-
js = d.createElement(s); js.id = id
|
|
22
|
-
js.src = 'https://connect.facebook.net/en_US/sdk.js'
|
|
23
|
-
fjs.parentNode.insertBefore(js, fjs)
|
|
24
|
-
}(document, 'script', 'facebook-jssdk'))
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
data () {
|
|
28
|
-
return {
|
|
29
|
-
facebookLoad: false
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
computed: {
|
|
33
|
-
fbLoginUrl () {
|
|
34
|
-
return 'https://www.facebook.com/v16.0/dialog/oauth?client_id=202577611527680&state={"oauth":"facebook"}&response_type=code%20granted_scopes&scope=email&redirect_uri=https://' + window.location.host + '/login'
|
|
35
|
-
},
|
|
36
|
-
displayFacebookLogin () {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
methods: {
|
|
41
|
-
async facebookLogin () {
|
|
42
|
-
this.facebookLoad = true
|
|
43
|
-
const FACEBOOK_PERMISSIONS = ['email']
|
|
44
|
-
const [errAuth, user] = await to(FacebookLogin.login({permissions: FACEBOOK_PERMISSIONS}))
|
|
45
|
-
if (errAuth) return this.facebookLoad = false
|
|
46
|
-
|
|
47
|
-
// Track Referrals
|
|
48
|
-
if (this.referral) user.ref = this.referral;
|
|
49
|
-
|
|
50
|
-
if (this.display === 'popup') user.response_type = 'code';
|
|
51
|
-
|
|
52
|
-
if (user && user.accessToken) {
|
|
53
|
-
|
|
54
|
-
const [err, response] = await to(AuthService.facebookSDK(user, this.$storex))
|
|
55
|
-
if (err) {
|
|
56
|
-
this.facebookLoad = false
|
|
57
|
-
EventBus.$emit('ssoEvent', {name: 'setLoading', data: false})
|
|
58
|
-
return this.errorHandler(err)
|
|
59
|
-
}
|
|
60
|
-
if (response.data.success) {
|
|
61
|
-
if (this.display === 'popup') {
|
|
62
|
-
return window.parent?.postMessage({ code: response.data.auth_code, state: this.$route.query.state }, '*');
|
|
63
|
-
}
|
|
64
|
-
await this.loginSetup(response)
|
|
65
|
-
await this.getLoggedInAccounts()
|
|
66
|
-
this.$router.push('/' + response.data.data.username + '#edit')
|
|
67
|
-
setTimeout(() => {
|
|
68
|
-
this.facebookLoad = false
|
|
69
|
-
EventBus.$emit('ssoEvent', {name: 'setLoading', data: false})
|
|
70
|
-
}, 1000)
|
|
71
|
-
} else this.errorSnack(this.ssoLang[this.appLanguage].unexpected_err)
|
|
72
|
-
} else {
|
|
73
|
-
this.facebookLoad = false
|
|
74
|
-
EventBus.$emit('ssoEvent', {name: 'setLoading', data: false})
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
File without changes
|