@tapni/auth 0.0.52 → 0.0.53

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tapni/auth",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "type": "module",
5
5
  "main": "./dist/TapniAuth.umd.js",
6
6
  "module": "./dist/TapniAuth.es.js",
@@ -19,7 +19,8 @@
19
19
  "dev": "vite",
20
20
  "build": "vite build --mode standalone",
21
21
  "preview": "vite preview",
22
- "build-lib": "vite build --config=vite-lib.config.js"
22
+ "build-lib": "vite build --config=vite-lib.config.js",
23
+ "publish": "npm publish"
23
24
  },
24
25
  "dependencies": {
25
26
  "@braintree/sanitize-url": "^7.0.0",
package/src/install.js CHANGED
@@ -5,7 +5,13 @@ import ReactiveStorage from '@tapni/capacitor-reactive-localstorage-vue3'
5
5
  export default {
6
6
  TapniAuth: App,
7
7
  install: (app, options) => {
8
- if (options && options.API_ROOT) app.config.globalProperties.$API_ROOT = options.API_ROOT;
8
+ if (options && options.API_ROOT) {
9
+ App.mixin({
10
+ created() {
11
+ this.API_ROOT = options.API_ROOT;
12
+ }
13
+ })
14
+ }
9
15
  app.component('TapniAuth', App);
10
16
  }
11
17
  };
package/src/main.js CHANGED
@@ -98,3 +98,6 @@ App.addListener('appUrlOpen', async function (data) {
98
98
  App.getLaunchUrl().then((data) => {
99
99
  redirectToProfile(data)
100
100
  });
101
+
102
+
103
+ export { app };
@@ -94,6 +94,9 @@ export default {
94
94
  }
95
95
  },
96
96
  methods: {
97
+ apiRootGet(){
98
+ return this.API_ROOT;
99
+ },
97
100
  errorHandler(error) {
98
101
  if (
99
102
  error &&
@@ -7,8 +7,9 @@ export default (storage, refreshTokenAction = false) => {
7
7
  const appInfo = version;
8
8
  let baseURL = import.meta.env.VITE_APP_API_ROOT + '/v1/';
9
9
 
10
- if (location.hostname.includes('dev.')) {
11
- baseURL = 'https://api-dev.tapni.co/v1/'
10
+ const apiRoot = AuthMixin.methods.apiRootGet();
11
+ if (apiRoot) {
12
+ baseURL = apiRoot
12
13
  }
13
14
 
14
15
  let apiInstance = axios.create({