@tapni/auth 1.0.5 → 1.0.6

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.
@@ -0,0 +1,124 @@
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
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapni/auth",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "type": "module",
5
5
  "main": "./dist/TapniAuth.umd.js",
6
6
  "module": "./dist/TapniAuth.es.js",
@@ -22,36 +22,36 @@
22
22
  "build-lib": "vite build --config=vite-lib.config.js"
23
23
  },
24
24
  "dependencies": {
25
- "@braintree/sanitize-url": "^7.0.0",
26
- "@capacitor-community/apple-sign-in": "^5.0.0",
27
- "@capacitor-community/facebook-login": "^5.0.3",
28
- "@capacitor/app": "^5.0.6",
29
- "@capacitor/browser": "^5.1.0",
30
- "@capacitor/core": "^5.6.0",
31
- "@capacitor/device": "^5.0.6",
32
- "@capacitor/preferences": "^5.0.6",
25
+ "@braintree/sanitize-url": "^7.1.0",
26
+ "@capacitor-community/apple-sign-in": "^6.0.0",
27
+ "@capacitor-community/facebook-login": "^6.0.0",
28
+ "@capacitor/app": "^6.0.2",
29
+ "@capacitor/browser": "^6.0.4",
30
+ "@capacitor/core": "^6.2.0",
31
+ "@capacitor/device": "^6.0.2",
32
+ "@capacitor/preferences": "^6.0.3",
33
33
  "@codetrix-studio/capacitor-google-auth": "^3.3.6",
34
34
  "@otplib/preset-browser": "^12.0.1",
35
- "@recognizebv/capacitor-plugin-msauth": "^3.5.1",
35
+ "@recognizebv/capacitor-plugin-msauth": "^3.6.1",
36
36
  "@tapni/capacitor-reactive-localstorage-vue3": "^0.0.17",
37
37
  "@tapni/styles": "^0.0.8",
38
38
  "await-to-js": "^3.0.0",
39
- "axios": "^1.6.5",
39
+ "axios": "^1.7.8",
40
40
  "buffer": "^6.0.3",
41
41
  "jwt-decode": "^4.0.0",
42
- "qr-code-styling": "^1.6.0-rc.1",
43
- "vue": "^3.3.11",
44
- "vue-cookies": "^1.8.3",
45
- "vue-router": "^4.2.5",
46
- "vue3-select-component": "^0.5.2",
47
- "vuex": "^4.0.2",
42
+ "qr-code-styling": "^1.8.4",
43
+ "vue": "^3.5.13",
44
+ "vue-cookies": "^1.8.4",
45
+ "vue-router": "^4.5.0",
46
+ "vue3-select-component": "^0.7.0",
47
+ "vuex": "^4.1.0",
48
48
  "vuex-router-sync": "v6.0.0-rc.1"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@rollup/plugin-inject": "^5.0.5",
52
- "@vitejs/plugin-vue": "^4.5.2",
53
- "office-addin-dev-certs": "^1.13.2",
54
- "vite": "^5.0.10",
52
+ "@vitejs/plugin-vue": "^5.2.1",
53
+ "office-addin-dev-certs": "^1.13.5",
54
+ "vite": "^6.0.1",
55
55
  "vite-plugin-node-polyfills": "^0.22.0"
56
56
  }
57
57
  }
package/src/App.vue CHANGED
@@ -21,6 +21,7 @@ document.addEventListener('DOMContentLoaded', function() {
21
21
 
22
22
  <AuthWelcome v-if="initialized && renderView === 'AuthWelcome'" />
23
23
  <AuthLogin v-else-if="initialized && renderView === 'AuthLogin'" :isModal="isModal" />
24
+ <AuthAccount v-else-if="initialized && renderView === 'AuthAccount'" :isModal="isModal" />
24
25
  <AuthRegister v-else-if="initialized && renderView === 'AuthRegister'" :isModal="isModal" />
25
26
  <AuthVerify v-else-if="initialized && renderView === 'AuthVerify'" :isModal="isModal" />
26
27
  <AuthSecurity v-else-if="initialized && renderView === 'AuthSecurity'" :isModal="isModal" :payload="payload" />
@@ -73,6 +74,7 @@ document.addEventListener('DOMContentLoaded', function() {
73
74
  import "../public/index.css";
74
75
  import AuthWelcome from "@/views/Welcome.vue";
75
76
  import AuthLogin from "@/views/Login.vue";
77
+ import AuthAccount from "@/views/Account.vue";
76
78
  import AuthRegister from "@/views/Register.vue";
77
79
  import AuthVerify from "@/views/Verify.vue";
78
80
  import AuthSecurity from "@/views/Security.vue";
@@ -100,7 +102,7 @@ export default {
100
102
  components: {
101
103
  Language,
102
104
  SSOPick,
103
- SSO, ModalOverlay, AuthCallback, AuthReset, AuthVerify, AuthSecurity, AuthRegister, AuthLogin, AuthWelcome
105
+ SSO, ModalOverlay, AuthCallback, AuthReset, AuthVerify, AuthSecurity, AuthRegister, AuthLogin, AuthAccount, AuthWelcome
104
106
  },
105
107
  props: {
106
108
  viewProp: {
@@ -1,153 +0,0 @@
1
- import { _ as g, A as d, C as u, E as h } from "./install-L-cxSovH.js";
2
- import { resolveComponent as p, openBlock as _, createElementBlock as m, createCommentVNode as n, createElementVNode as o, toDisplayString as t, createVNode as a, withCtx as c } from "vue";
3
- const f = {
4
- mixins: [d],
5
- data() {
6
- return {
7
- expanded: !1,
8
- addAccountReady: !1
9
- };
10
- },
11
- computed: {
12
- appVersion() {
13
- return u.WEB_VERSION;
14
- }
15
- },
16
- async mounted() {
17
- if (!this.isLoggedIn)
18
- return this.$router.push("/");
19
- this.getAccountSettings();
20
- },
21
- methods: {
22
- continueTo(e) {
23
- console.log("continue to " + e);
24
- },
25
- addAccount() {
26
- this.$router.push("/login");
27
- },
28
- switchAccount(e) {
29
- console.log("switch", e);
30
- },
31
- toggleLanguageModal() {
32
- h.$emit("toggleSSOLanguageModal");
33
- },
34
- logoutAccount() {
35
- this.logout({ refreshToken: this.refreshTokens[0], sendRequest: !0 });
36
- }
37
- }
38
- }, v = {
39
- class: "page-login content-boxed content-boxed-padding center-text",
40
- style: { "margin-top": "-1px", overflow: "hidden", border: "solid 0px #ffffff" }
41
- }, w = /* @__PURE__ */ o("br", null, null, -1), k = { class: "bold full-top no-bottom center-text" }, b = { class: "full-bottom half-top center-text font-16" };
42
- const L = { class: "container left-text" }, y = { class: "firstRow" }, N = ["src"], R = ["src"], V = { class: "firstRow" }, A = ["src"], E = ["src"], I = { class: "firstRow" }, B = ["src"], S = ["src"], T = { class: "firstRow" }, C = ["src"], $ = ["src"], D = { class: "firstRow" }, M = ["src"], O = { class: "red-text" }, q = ["src"], F = { class: "moreFooter" }, W = {
43
- class: "app-version",
44
- style: { "margin-top": "10px" }
45
- };
46
- function j(e, r, z, G, H, l) {
47
- const s = p("router-link");
48
- return _(), m("div", v, [
49
- w,
50
- n("", !0),
51
- o("h1", k, t(e.ssoLang[e.appLanguage].welcome_account), 1),
52
- o("p", b, t(e.account.email), 1),
53
- (e.display, n("", !0)),
54
- o("div", L, [
55
- n("", !0),
56
- a(s, {
57
- to: "/general",
58
- class: "settingRow"
59
- }, {
60
- default: c(() => [
61
- o("div", y, [
62
- o("img", {
63
- src: e.getIcon("user-black.svg"),
64
- class: "withBackground"
65
- }, null, 8, N),
66
- o("h4", null, t(e.ssoLang[e.appLanguage].general), 1),
67
- o("img", {
68
- src: e.getIcon("arrow-gray-right.svg")
69
- }, null, 8, R)
70
- ])
71
- ]),
72
- _: 1
73
- }),
74
- a(s, {
75
- to: "/security",
76
- class: "settingRow"
77
- }, {
78
- default: c(() => [
79
- o("div", V, [
80
- o("img", {
81
- src: e.getIcon("shield-black.svg"),
82
- class: "withBackground"
83
- }, null, 8, A),
84
- o("h4", null, t(e.ssoLang[e.appLanguage].security), 1),
85
- o("img", {
86
- src: e.getIcon("arrow-gray-right.svg")
87
- }, null, 8, E)
88
- ])
89
- ]),
90
- _: 1
91
- }),
92
- a(s, {
93
- to: "/apps",
94
- class: "settingRow"
95
- }, {
96
- default: c(() => [
97
- o("div", I, [
98
- o("img", {
99
- src: e.getIcon("apps-black.svg"),
100
- class: "withBackground"
101
- }, null, 8, B),
102
- o("h4", null, t(e.ssoLang[e.appLanguage].apps), 1),
103
- o("img", {
104
- src: e.getIcon("arrow-gray-right.svg")
105
- }, null, 8, S)
106
- ])
107
- ]),
108
- _: 1
109
- }),
110
- a(s, {
111
- to: "/billing",
112
- class: "settingRow"
113
- }, {
114
- default: c(() => [
115
- o("div", T, [
116
- o("img", {
117
- src: e.getIcon("billing-card-black.svg"),
118
- class: "withBackground"
119
- }, null, 8, C),
120
- o("h4", null, t(e.ssoLang[e.appLanguage].billing), 1),
121
- o("img", {
122
- src: e.getIcon("arrow-gray-right.svg")
123
- }, null, 8, $)
124
- ])
125
- ]),
126
- _: 1
127
- }),
128
- o("div", {
129
- class: "settingRow",
130
- onClick: r[4] || (r[4] = (...i) => l.logoutAccount && l.logoutAccount(...i))
131
- }, [
132
- o("div", D, [
133
- o("img", {
134
- src: e.getIcon("logout-red.svg"),
135
- class: "withBackground"
136
- }, null, 8, M),
137
- o("h4", O, t(e.ssoLang[e.appLanguage].logout), 1),
138
- o("img", {
139
- src: e.getIcon("arrow-gray-right.svg")
140
- }, null, 8, q)
141
- ])
142
- ]),
143
- o("div", F, [
144
- o("p", W, t(e.ssoLang[e.appLanguage].version) + ": " + t(l.appVersion), 1),
145
- n("", !0)
146
- ])
147
- ])
148
- ]);
149
- }
150
- const Q = /* @__PURE__ */ g(f, [["render", j]]);
151
- export {
152
- Q as default
153
- };
@@ -1,83 +0,0 @@
1
- import { _ as u, A as _, b as g, E as h } from "./install-L-cxSovH.js";
2
- import { resolveComponent as m, openBlock as o, createElementBlock as n, createCommentVNode as i, createElementVNode as e, createBlock as f, withCtx as b, toDisplayString as r, pushScopeId as y, popScopeId as v } from "vue";
3
- const x = {
4
- name: "AuthCustomApp",
5
- mixins: [_],
6
- props: {
7
- payload: {
8
- type: Object,
9
- default: {}
10
- }
11
- },
12
- data() {
13
- return {
14
- loading: !1,
15
- app: {}
16
- };
17
- },
18
- async mounted() {
19
- this.isLoggedIn || this.$router.push("/login");
20
- const t = await g.getRecordById({
21
- id: this.$route.params.app,
22
- query: {
23
- fields: ["t_apps_name", "t_apps_icon", "t_apps_url"],
24
- relations: []
25
- }
26
- });
27
- this.app = t.data.record;
28
- },
29
- methods: {
30
- close() {
31
- h.$emit("ssoEvent", { name: "toggleAuthModal", data: !0 });
32
- }
33
- }
34
- }, p = (t) => (y("data-v-36b27d1f"), t = t(), v(), t), k = { class: "page-login content-boxed content-boxed-padding" }, w = /* @__PURE__ */ p(() => /* @__PURE__ */ e("i", { class: "font-17 color-black" }, [
35
- /* @__PURE__ */ e("img", {
36
- src: "https://cdn.tapni.co/icons/down-arrow.png",
37
- class: "responsive-image",
38
- style: { width: "35%" }
39
- })
40
- ], -1)), A = [
41
- w
42
- ], C = { class: "subheaderContainer full-top" }, I = ["src"], B = {
43
- class: "center-text",
44
- style: { "flex-grow": "1", "text-align": "center", margin: "0", "font-weight": "600" }
45
- }, E = { class: "container left-text" }, S = { class: "center-text" }, M = /* @__PURE__ */ p(() => /* @__PURE__ */ e("div", { class: "full-top" }, null, -1));
46
- function $(t, s, L, N, c, a) {
47
- const l = m("router-link");
48
- return o(), n("div", k, [
49
- t.isModal ? (o(), n("a", {
50
- key: 0,
51
- onClick: s[0] || (s[0] = (...d) => a.close && a.close(...d)),
52
- class: "color-black pull-right pointer",
53
- style: { "margin-top": "0px", position: "absolute", right: "-20px", "text-align": "right" }
54
- }, A)) : i("", !0),
55
- e("div", C, [
56
- t.isModal ? i("", !0) : (o(), f(l, {
57
- key: 0,
58
- to: "/apps",
59
- class: "button gray-button pointer left-button"
60
- }, {
61
- default: b(() => [
62
- e("img", {
63
- src: t.getIcon("arrow-gray-right.svg"),
64
- height: "20",
65
- width: "20",
66
- class: "btn-icon",
67
- style: { rotate: "180deg" }
68
- }, null, 8, I)
69
- ]),
70
- _: 1
71
- })),
72
- e("h2", B, r(c.app.t_apps_name), 1)
73
- ]),
74
- e("div", E, [
75
- e("p", S, r(t.ssoLang[t.appLanguage].apps_p), 1),
76
- M
77
- ])
78
- ]);
79
- }
80
- const q = /* @__PURE__ */ u(x, [["render", $], ["__scopeId", "data-v-36b27d1f"]]);
81
- export {
82
- q as default
83
- };