@tapni/auth 0.0.1 → 0.0.2

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.
Files changed (72) hide show
  1. package/dist/.vite/manifest.json +11 -0
  2. package/dist/TapniAuth.es.js +6806 -0
  3. package/dist/TapniAuth.umd.js +102 -0
  4. package/dist/style.css +1 -0
  5. package/package.json +5 -2
  6. package/.env.development +0 -5
  7. package/.env.production +0 -8
  8. package/.env.staging +0 -8
  9. package/.env.standalone +0 -4
  10. package/.vscode/extensions.json +0 -3
  11. package/index.html +0 -35
  12. package/jsconfig.json +0 -8
  13. package/src/App.vue +0 -269
  14. package/src/components/Language.vue +0 -158
  15. package/src/components/LinkIcon.vue +0 -288
  16. package/src/components/ModalOverlay.vue +0 -67
  17. package/src/components/SSO.vue +0 -126
  18. package/src/components/SSOPick.vue +0 -166
  19. package/src/install.js +0 -8
  20. package/src/main.js +0 -96
  21. package/src/mixins/apple.mixin.js +0 -60
  22. package/src/mixins/auth.mixin.js +0 -525
  23. package/src/mixins/facebook.mixin.js +0 -78
  24. package/src/mixins/global.mixin.js +0 -110
  25. package/src/mixins/google.mixin.js +0 -61
  26. package/src/mixins/microsoft.mixin.js +0 -88
  27. package/src/mixins/okta.mixin.js +0 -132
  28. package/src/mixins/qr-auth.mixin.js +0 -112
  29. package/src/mixins/saml.mixin.js +0 -84
  30. package/src/router/index.js +0 -9
  31. package/src/routes.js +0 -55
  32. package/src/services/Api.js +0 -55
  33. package/src/services/AuthService.js +0 -71
  34. package/src/services/CompanyService.js +0 -13
  35. package/src/services/DeviceService.js +0 -10
  36. package/src/services/UserService.js +0 -49
  37. package/src/services/UtilService.js +0 -221
  38. package/src/store/constants.js +0 -8
  39. package/src/store/event-bus.js +0 -30
  40. package/src/store/locales/cn.js +0 -462
  41. package/src/store/locales/de.js +0 -528
  42. package/src/store/locales/en.js +0 -514
  43. package/src/store/locales/es.js +0 -536
  44. package/src/store/locales/fr.js +0 -520
  45. package/src/store/locales/it.js +0 -518
  46. package/src/store/locales/kr.js +0 -496
  47. package/src/store/locales/lang.js +0 -47
  48. package/src/store/locales/sr.js +0 -497
  49. package/src/store/locales/tr.js +0 -491
  50. package/src/styles/framework.css +0 -4012
  51. package/src/styles/inter.ttf +0 -0
  52. package/src/styles/style.css +0 -618
  53. package/src/views/Callback.vue +0 -47
  54. package/src/views/Login.vue +0 -389
  55. package/src/views/QR.vue +0 -39
  56. package/src/views/Register.vue +0 -217
  57. package/src/views/Reset.vue +0 -155
  58. package/src/views/Verify.vue +0 -170
  59. package/src/views/Welcome.vue +0 -69
  60. package/vite.config.js +0 -58
  61. /package/{public → dist}/.gitkeep +0 -0
  62. /package/{public → dist}/.well-known/apple-app-site-association +0 -0
  63. /package/{public → dist}/.well-known/assetlinks.json +0 -0
  64. /package/{public → dist}/.well-known/microsoft-identity-association.json +0 -0
  65. /package/{public → dist}/android-chrome-192x192.png +0 -0
  66. /package/{public → dist}/android-chrome-512x512.png +0 -0
  67. /package/{public → dist}/apple-touch-icon.png +0 -0
  68. /package/{public → dist}/favicon-16x16.png +0 -0
  69. /package/{public → dist}/favicon-32x32.png +0 -0
  70. /package/{public → dist}/favicon.ico +0 -0
  71. /package/{public → dist}/icon.png +0 -0
  72. /package/{public → dist}/site.webmanifest +0 -0
@@ -1,155 +0,0 @@
1
- <template>
2
- <form v-if="!passwordChange" class="page-login content-boxed content-boxed-padding" @submit.prevent="resetEmail" autocomplete="on">
3
- <h3 class="bold no-bottom center-text" style="margin-top: 63px;">{{ssoLang[this.appLang].reset_password}}</h3>
4
- <p class="half-bottom small-top center-text color-black"></p>
5
- <div class="page-login-field half-top color-black">
6
- <i style="padding-top: 15px; margin-left: 10px;">
7
- <img src="https://cdn.tapni.co/icons/mail.png" class="responsive-image" style="width: 80%;">
8
- </i>
9
- <input id="emailInput" v-model="email" @keydown.space.prevent type="email" :placeholder="ssoLang[this.appLang].email" required>
10
- <em></em>
11
- </div>
12
- <button type="submit" class="button black-button google-button bg-tapni-grey button-90 button-center uppercase bold full-top">
13
- <span v-if="!submitted" class="uppercase">{{ssoLang[this.appLang].reset_password}}</span>
14
- <span v-else class="button--loading button__loader"></span>
15
- </button>
16
- <div class="decoration decoration-lines-thin no-bottom half-top"></div>
17
- <p class="close-text center-text half-top color-black">
18
- <span v-html="ssoLang[this.appLang].reset_password_p1"></span><a :href="'mailto:support@tapni.co?subject=' + ssoLang[this.appLang].password_reset_t"> support@tapni.co</a>
19
- </p>
20
- <div class="decoration decoration-lines-thin no-bottom half-top"></div>
21
-
22
- <div class="page-login-links">
23
- <router-link class="create float-right" to="/verify">{{ssoLang[this.appLang].verify_account}}</router-link>
24
- <router-link class="forgot float-left" to="/login">{{ssoLang[this.appLang].sign_in}}</router-link>
25
- <div class="clear"></div>
26
- </div>
27
- </form>
28
- <form v-else class="page-login content-boxed content-boxed-padding" @submit.prevent="changePw">
29
- <h3 class="bold no-bottom center-text" style="margin-top: 63px;">{{ssoLang[this.appLang].password_change}}</h3>
30
- <p class="half-bottom small-top center-text color-black">{{ssoLang[this.appLang].password_new}}</p>
31
- <div class="page-login-field half-top">
32
- <i style="padding-top: 15px">
33
- <img src="https://cdn.tapni.co/icons/padlock.png" class="responsive-image" style="width: 50%;">
34
- </i>
35
- <input v-model="password" :type="revealPassword ? 'text' : 'password'" :placeholder="ssoLang[this.appLang].password" required>
36
- <em @click="revealPassword = !revealPassword">
37
- <img v-show="!revealPassword" src="https://cdn.tapni.co/icons/reveal-password.png" class="responsive-image password-reveal-icon">
38
- <img v-show="revealPassword" src="https://cdn.tapni.co/icons/hide-password.png" class="responsive-image password-reveal-icon">
39
- </em>
40
- </div>
41
- <div class="page-login-field half-top">
42
- <i style="padding-top: 15px">
43
- <img src="https://cdn.tapni.co/icons/padlock.png" class="responsive-image" style="width: 50%;">
44
- </i>
45
- <input v-model="passwordRepeat" :type="revealPassword2 ? 'text' : 'password'" :placeholder="ssoLang[this.appLang].password_repeat" required>
46
- <em @click="revealPassword2 = !revealPassword2">
47
- <img v-show="!revealPassword2" src="https://cdn.tapni.co/icons/reveal-password.png" class="responsive-image password-reveal-icon">
48
- <img v-show="revealPassword2" src="https://cdn.tapni.co/icons/hide-password.png" class="responsive-image password-reveal-icon">
49
- </em>
50
- </div>
51
- <button type="submit" class="button black-button google-button bg-tapni-grey button-90 button-center uppercase bold full-top">
52
- <span v-if="!submitted" class="uppercase">{{ssoLang[this.appLang].password_change}}</span>
53
- <span v-else class="button--loading button__loader"></span>
54
- </button>
55
-
56
- <div class="decoration decoration-lines-thin no-bottom half-top"></div>
57
- <p class="close-text center-text half-top color-black">
58
- <span v-html="ssoLang[this.appLang].reset_password_p2"></span> <a :href="'mailto:support@tapni.co?subject=' + ssoLang[this.appLang].password_reset_t"> support@tapni.co</a>
59
- </p>
60
- </form>
61
- </template>
62
-
63
- <script>
64
- import AuthMixin from "../mixins/auth.mixin";
65
- import {EventBus} from "../store/event-bus";
66
-
67
- export default {
68
- name: 'AuthReset',
69
- mixins: [AuthMixin],
70
- data () {
71
- return {
72
- loading: true,
73
- submitted: false,
74
- passwordChange: false,
75
- email: '',
76
- password: '',
77
- passwordRepeat: '',
78
- code: '',
79
- captcha: '',
80
- revealPassword: false,
81
- revealPassword2: false,
82
- }
83
- },
84
- mounted () {
85
- if (this.storage.verifyEmail) {
86
- this.email = this.storage.verifyEmail
87
- }
88
- if (this.$route.query.c) {
89
- this.code = this.$route.query.c;
90
- this.passwordChange = true
91
- }
92
- if (this.$route.query.e) {
93
- this.email = this.$route.query.e
94
- }
95
- EventBus.$emit('ssoEvent', {name: 'setLoading', data: false})
96
- },
97
- methods: {
98
- async resetEmail() {
99
- // if (this.captcha === '') return this.errorHandler({ message: 'Please select recaptcha' });
100
-
101
- if (this.submitted) return
102
- this.submitted = true
103
-
104
- this.email = this.email.trim()
105
-
106
- let data = {
107
- email: this.email,
108
- captchaToken: await this.getCaptchaToken('password_reset')
109
- };
110
-
111
- await this.reset(data)
112
- this.submitted = false
113
- await this.$router.push('/verify?e=' + this.email + '#reset')
114
-
115
- },
116
- async changePw() {
117
- // if (this.captcha === '') return this._vm.errorHandler({ message: 'Please select recaptcha' });
118
- if (this.code.length !== 6) return this.errorSnack(this.ssoLang[this.appLang].invalid_code);
119
- if (this.password !== this.passwordRepeat) return this.errorSnack(this.ssoLang[this.appLang].password_not_match);
120
-
121
- if (this.submitted) return
122
- this.submitted = true
123
-
124
- this.email = this.email.trim()
125
- this.code = this.code.trim()
126
-
127
- let data = {
128
- email: this.email,
129
- code: this.code,
130
- password: this.password,
131
- passwordRepeat: this.passwordRepeat,
132
- captchaToken: await this.getCaptchaToken('password_reset')
133
- };
134
-
135
- let success = await this.changePassword(data)
136
- this.submitted = false
137
- if (success === true) {
138
- this.$router.push('/login');
139
- this.successSnack(this.ssoLang[this.appLang].password_reseted_success);
140
- }
141
- },
142
- },
143
- watch: {
144
- email(nv) { this.storage.verifyEmail = nv }
145
- }
146
- }
147
- </script>
148
-
149
- <style scoped>
150
- #emailInput {
151
- text-align: center;
152
- padding-right: 15%;
153
- font-size: 17px;
154
- }
155
- </style>
@@ -1,170 +0,0 @@
1
- <template>
2
- <form class="page-login content-boxed content-boxed-padding" @submit.prevent="submit" :style="isModal ? 'max-width: 500px;' : ''">
3
- <a v-if="isModal" @click="close" class="color-black pull-right pointer" style="margin-top: 0px; position: absolute; right: -20px; text-align: right;">
4
- <i class="font-17 color-black">
5
- <img src="https://cdn.tapni.co/icons/down-arrow.png" class="responsive-image" style="width: 35%;"/>
6
- </i>
7
- </a>
8
- <h1 class="bold no-bottom center-text" style="margin-top: 63px;">{{ssoLang[this.appLang].verify_account}}</h1>
9
- <p class="half-bottom half-top center-text color-black"></p>
10
- <div class="page-login-field half-top">
11
- <i style="padding-top: 15px; margin-left: 10px;">
12
- <img src="https://cdn.tapni.co/icons/mail.png" class="responsive-image" style="width: 80%;">
13
- </i>
14
- <input id="emailInput" v-model="email" @keydown.space.prevent type="email" :placeholder="ssoLang[this.appLang].email" required>
15
- <em></em>
16
- </div>
17
- <div class="page-login-field half-top">
18
- <i style="padding-top: 15px; margin-left: 10px;">
19
- <img src="https://cdn.tapni.co/icons/password2.png" class="responsive-image" style="width: 100%;">
20
- </i>
21
- <input id="codeInput" v-model="code" @keydown.space.prevent type="tel" :placeholder="ssoLang[this.appLang].code" required>
22
- <em></em>
23
- </div>
24
- <button type="submit" class="button black-button google-button bg-tapni-grey button-90 button-center uppercase bold full-top">
25
- <span v-if="!submitted" class="uppercase">{{ssoLang[this.appLang].verify_account}}</span>
26
- <span v-else class="button--loading button__loader"></span>
27
- </button>
28
- <div class="decoration decoration-lines-thin no-bottom"></div>
29
-
30
- <p class="close-text center-text half-top color-black">
31
- <span v-html="ssoLang[this.appLang].verify_account_p1"></span>
32
- <a href="mailto:support@tapni.co?subject=Email Verification"> support@tapni.co</a>
33
- </p>
34
-
35
- <div class="decoration decoration-lines-thin no-bottom"></div>
36
- <div v-if="!isModal" class="page-login-links">
37
- <router-link class="create float-right" to="/register">{{ssoLang[this.appLang].register}}</router-link>
38
- <router-link class="forgot float-left" to="/login">{{ssoLang[this.appLang].sign_in}}</router-link>
39
- <div class="clear"></div>
40
- </div>
41
- <div v-else class="page-login-links" @click="registerAccountModal">
42
- <a class="forgot center-text pointer small-top">{{ssoLang[this.appLang].or}} <br> {{ssoLang[this.appLang].create_new_account}}</a>
43
- <div class="clear"></div>
44
- </div>
45
- </form>
46
- </template>
47
-
48
- <script>
49
- import {EventBus} from "../store/event-bus";
50
- import AuthMixin from "../mixins/auth.mixin";
51
- export default {
52
- name: 'AuthVerify',
53
- mixins: [AuthMixin],
54
- props: {
55
- isModal: {
56
- type: Boolean,
57
- required: false,
58
- default: false
59
- },
60
- },
61
- data () {
62
- return {
63
- loading: true,
64
- submitted: false,
65
- action: 'verify',
66
- email: '',
67
- code: '',
68
- captcha: ''
69
- }
70
- },
71
- mounted () {
72
- if (this.storage.verifyEmail) this.email = this.storage.verifyEmail
73
- if (this.$route) this.init()
74
- },
75
- methods: {
76
- init() {
77
- if (this.isLoggedIn) {
78
- this.$router.push(this.home)
79
- } else {
80
- if (this.storage.verifyEmail) {
81
- this.email = this.storage.verifyEmail
82
- }
83
- if (this.$route.hash === '#reset') {
84
- this.action = 'reset'
85
- }
86
- if (this.$route.query.e) {
87
- this.email = this.$route.query.e
88
- }
89
- if (this.$route.query.c) {
90
- this.code = this.$route.query.c
91
- }
92
- EventBus.$emit('ssoEvent', {name: 'setLoading', data: false})
93
- }
94
- },
95
- async submit() {
96
- // if (this.captcha === '') return this._vm.errorHandler({ message: 'Please select recaptcha' });
97
- if (this.code.length !== 6) {
98
- return this.errorSnack(this.ssoLang[this.appLang].invalid_code);
99
- }
100
-
101
- this.email = this.email.trim()
102
- this.code = this.code.trim()
103
-
104
- let data = {
105
- code: this.code,
106
- email: this.email,
107
- captchaToken: await this.getCaptchaToken('account_verify')
108
- }
109
-
110
- if(this.submitted) return false;
111
- this.submitted = true
112
-
113
- let response = await this.verify(data);
114
- this.submitted = false
115
- if (response && response.data && response.data.success === true) {
116
- if (this.action === 'reset') {
117
- this.$router.push('/reset?c=' + this.code + '&e=' + this.email)
118
- this.successSnack(this.ssoLang[this.appLang].verify_account_success)
119
- }
120
- if (this.action === 'verify') {
121
- if (this.isModal) {
122
- this.email = ''
123
- this.code = ''
124
- EventBus.$emit('closeModal')
125
- }
126
- await this.loginSetup(response)
127
- this.getLoggedInAccounts()
128
- this.storage.verifyEmail = '';
129
- this.$router.push('/' + response.data.data.username + '#edit')
130
- this.successSnack(this.ssoLang[this.appLang].verify_account_success2)
131
- }
132
- } else this.submitted = false
133
-
134
- },
135
- registerAccountModal () {
136
- EventBus.$emit('ssoEvent', {name: 'toggleAddAccountModalRegister', data: false})
137
- },
138
- close () {
139
- EventBus.$emit('ssoEvent', {name: 'toggleAddAccountModal', data: true})
140
- },
141
- },
142
- watch: {
143
- 'storage.verifyEmail' (nv) {
144
- if (nv) this.email = nv
145
- },
146
- 'route.name' (nv, ov) {
147
- if (!ov && nv) this.init()
148
- },
149
- 'route.query': {
150
- handler(nv) {
151
- if (!this.isEmpty(nv)) this.init()
152
- },
153
- deep: true,
154
- },
155
- }
156
- }
157
- </script>
158
-
159
- <style scoped>
160
- #codeInput {
161
- text-align: center;
162
- padding-right: 15%;
163
- font-size: 17px;
164
- }
165
- #emailInput {
166
- text-align: center;
167
- padding-right: 15%;
168
- font-size: 17px;
169
- }
170
- </style>
@@ -1,69 +0,0 @@
1
- <template>
2
- <div class="page-login content-boxed content-boxed-padding center-text" style="margin-top: -1px; overflow: hidden; border: solid 0px #ffffff;">
3
- <video id="tapniVideo" muted loop playsinline width="350" style="margin: 0 auto; max-width: 100%; margin-top: 63px; overflow: hidden;" :autoplay="isNative">
4
- <source src="https://cdn.tapni.co/images/tapni-card-tap-video-white.mp4" type="video/mp4">
5
- </video>
6
- <h1 class="bold full-top no-bottom center-text">{{ssoLang[this.appLang].welcome}}</h1>
7
- <p class="full-bottom half-top center-text color-black font-16">{{ssoLang[this.appLang].welcome_p1}}</p>
8
- <router-link v-if="false" to="/help" class="button-center button button-90 google-button pointer edit-shadow full-top full-bottom">
9
- <span> {{ssoLang[this.appLang].how_it_works}}? </span>
10
- </router-link>
11
- <div v-if="false" class="decoration decoration-lines-thin full-top"></div>
12
- <router-link to="register" exact class="button-center button button-90 google-button bg-tapni-grey pointer">
13
- <span> {{ssoLang[this.appLang].create_account}} </span>
14
- </router-link>
15
- <!--
16
- <button @click="test" class="button-center button button-90 google-button bg-tapni-grey pointer">
17
- Test
18
- </button>
19
- -->
20
- <div class="page-login-links center-text">
21
- <router-link to="/login">{{ssoLang[this.appLang].already_registered}}? <b>{{ssoLang[this.appLang].sign_in}}</b></router-link>
22
- <div class="clear"></div>
23
- </div>
24
- <div v-if=(!this.isNative) style="display: flex; flex-direction: row; justify-content: space-around; width: 90%; margin: 0 auto; margin-top: 40px;" >
25
- <a href="https://play.google.com/store/apps/details?id=co.tapni.app" target="_blank"><img src="https://cdn.tapni.co/images/playstore.png" class="app-store-icon pointer" style="width:55px"/></a>
26
- <a href="https://apps.apple.com/ag/app/tapni/id1552930233" target="_blank"><img src="https://cdn.tapni.co/images/appstore.png" class="app-store-icon pointer" style="width:55px"/></a>
27
- <a href="https://appgallery.huawei.com/#/app/C103931997" target="_blank"><img src="https://cdn.tapni.co/images/appgallery.png" class="app-store-icon pointer" style="width:55px"/></a>
28
- </div>
29
- </div>
30
- </template>
31
-
32
- <script>
33
- import AuthMixin from "../mixins/auth.mixin";
34
- import {EventBus} from "../store/event-bus";
35
-
36
- export default {
37
- name: 'AuthWelcome',
38
- mixins: [AuthMixin],
39
- data () {
40
- return {
41
- loading: true
42
- }
43
- },
44
- async mounted () {
45
- // Autoplay video - iOS 12 controls fix
46
- const video = document.getElementById('tapniVideo');
47
- video.play();
48
-
49
- setTimeout(() => {
50
- if (this.storage.token) {
51
- this.$router.push(this.home)
52
- } else {
53
- EventBus.$emit('ssoEvent', {name: 'setLoading', data: false})
54
- }
55
- }, 1500)
56
-
57
- EventBus.$emit('ssoEvent', {name: 'setInitialize', data: true})
58
- },
59
- methods: {
60
- }
61
- }
62
- </script>
63
-
64
- <style scoped>
65
- .app-store-icon {
66
- box-shadow: 0px 4px 10px 0px rgb(0 0 0 / 9%);
67
- border-radius: 12px;
68
- }
69
- </style>
package/vite.config.js DELETED
@@ -1,58 +0,0 @@
1
- import { defineConfig } from 'vite';
2
- import vue from '@vitejs/plugin-vue';
3
- import { fileURLToPath, URL } from 'node:url'
4
-
5
- export default defineConfig({
6
- server: {
7
- port: 8083
8
- },
9
- plugins: [vue()],
10
- resolve: {
11
- alias: {
12
- '@': fileURLToPath(new URL('./src', import.meta.url))
13
- }
14
- },
15
- build: {
16
- manifest: true,
17
- // minify: true,
18
- reportCompressedSize: true,
19
- lib: {
20
- entry: './src/install.js', // Update this path
21
- name: 'TapniAuth', // The name of your library
22
- fileName: (format) => `TapniAuth.${format}.js`
23
- },
24
- rollupOptions: {
25
- // Externalize dependencies that shouldn't be bundled
26
- // into your library
27
- external: [
28
- 'vue',
29
- 'vuex',
30
- 'axios',
31
- // Add other dependencies you want to exclude from the bundle
32
- '@braintree/sanitize-url',
33
- '@capacitor-community/apple-sign-in',
34
- '@capacitor-community/facebook-login',
35
- '@capacitor/app',
36
- '@capacitor/browser',
37
- '@capacitor/core',
38
- '@capacitor/device',
39
- '@codetrix-studio/capacitor-google-auth',
40
- '@recognizebv/capacitor-plugin-msauth',
41
- '@tapni/capacitor-reactive-localstorage-vue3',
42
- 'await-to-js',
43
- '@tapni/capacitor-reactive-localstorage-vue3',
44
- 'jwt-decode',
45
- 'qr-code-styling',
46
- 'vue-cookies',
47
- 'vue-router'
48
- ],
49
- output: {
50
- // Provide global variables to use in the UMD build
51
- // for externalized deps
52
- globals: {
53
- vue: 'Vue'
54
- }
55
- }
56
- }
57
- }
58
- });
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes