@drax/identity-vue 0.8.0 → 0.8.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.
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.8.0",
6
+ "version": "0.8.2",
7
7
  "type": "module",
8
8
  "main": "./src/index.ts",
9
9
  "module": "./src/index.ts",
@@ -66,5 +66,5 @@
66
66
  "vue-tsc": "^2.1.6",
67
67
  "vuetify": "^3.7.1"
68
68
  },
69
- "gitHead": "4c5c82ae5a92ea25c75f821b5aa1e64126b131cb"
69
+ "gitHead": "fda6743b977ef7c294f1d33507c7329e46297ed8"
70
70
  }
@@ -4,11 +4,12 @@ import {defineModel} from "vue";
4
4
  import IdentityProfileView from "../IdentityProfileView/IdentityProfileView.vue";
5
5
  import {useRouter} from "vue-router";
6
6
  import {useI18n} from "vue-i18n";
7
+ import { useDisplay } from 'vuetify'
7
8
 
8
9
  const {t} = useI18n()
9
10
  const router = useRouter()
10
11
 
11
-
12
+ const {mobile} = useDisplay()
12
13
  const auth = useAuth()
13
14
  const valueModel = defineModel<boolean>()
14
15
 
@@ -16,17 +17,14 @@ const valueModel = defineModel<boolean>()
16
17
  </script>
17
18
 
18
19
  <template>
19
-
20
-
21
20
  <v-navigation-drawer
22
21
  v-model="valueModel"
23
- location="right"
22
+ :location="mobile ? 'top' : 'right'"
24
23
  >
25
24
 
26
25
  <template v-if="auth.isAuthenticated()">
27
26
  <identity-profile-view></identity-profile-view>
28
27
  <v-divider></v-divider>
29
-
30
28
  <v-list>
31
29
  <v-list-item
32
30
  @click="router.push({name:'Profile'})"
@@ -17,6 +17,15 @@ export function useAuth() {
17
17
  authStore.setAuthUser(authUser)
18
18
  }
19
19
 
20
+ const loginWithToken = async (token: string) => {
21
+ authStore.setAccessToken(token)
22
+ if(tokenIsValid()){
23
+ const authUser = await authSystem.me()
24
+ authStore.setAuthUser(authUser)
25
+ }
26
+
27
+ }
28
+
20
29
  const changeOwnPassword = async (currentPassword: string, newPassword: string) => {
21
30
  return await authSystem.changeOwnPassword(currentPassword, newPassword)
22
31
  }
@@ -64,6 +73,6 @@ export function useAuth() {
64
73
 
65
74
  }
66
75
 
67
- return {hasPermission, logout, tokenIsValid, isAuthenticated, fetchAuthUser, login, changeOwnPassword, changeAvatar}
76
+ return {hasPermission, logout, loginWithToken, tokenIsValid, isAuthenticated, fetchAuthUser, login, changeOwnPassword, changeAvatar}
68
77
 
69
78
  }