@saooti/octopus-sdk 38.1.3 → 38.1.4

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": "@saooti/octopus-sdk",
3
- "version": "38.1.3",
3
+ "version": "38.1.4",
4
4
  "private": false,
5
5
  "description": "Javascript SDK for using octopus",
6
6
  "author": "Saooti",
@@ -60,9 +60,9 @@
60
60
  </template>
61
61
  </template>
62
62
  <hr />
63
- <a class="octopus-dropdown-item" href="/logout" realLink="true">
63
+ <button class="octopus-dropdown-item" @click="logoutFunction">
64
64
  {{ $t("Logout") }}
65
- </a>
65
+ </button>
66
66
  </template>
67
67
  <router-link class="octopus-dropdown-item" to="/main/pub/contact">
68
68
  {{ $t("Contact") }}
@@ -72,6 +72,7 @@
72
72
  </template>
73
73
 
74
74
  <script lang="ts">
75
+ import octopusApi from "@saooti/octopus-api";
75
76
  import { state } from "../../stores/ParamSdkStore";
76
77
  import ClassicPopover from "../misc/ClassicPopover.vue";
77
78
  import { useAuthStore } from "@/stores/AuthStore";
@@ -147,5 +148,15 @@ export default defineComponent({
147
148
  return state.generalParameters.isContribution ?? false;
148
149
  },
149
150
  },
151
+ methods:{
152
+ async logoutFunction(){
153
+ try {
154
+ await octopusApi.postDataPublic(4, '/logout', undefined);
155
+ this.$router.push('/');
156
+ } catch (error) {
157
+ //Do nothing
158
+ }
159
+ }
160
+ }
150
161
  });
151
162
  </script>
@@ -20,15 +20,24 @@
20
20
  />
21
21
  </div>
22
22
 
23
+ <button
24
+ v-if="authenticated"
25
+ class="btn btn-primary"
26
+ @click="logoutFunction"
27
+
28
+ >{{ authText }}</button
29
+ >
23
30
  <a
31
+ v-else
24
32
  class="btn btn-primary"
25
- :href="authenticated ? '/logout' : '/sso/login'"
33
+ href="/sso/login"
26
34
  >{{ authText }}</a
27
35
  >
28
36
  </div>
29
37
  </template>
30
38
 
31
39
  <script lang="ts">
40
+ import octopusApi from "@saooti/octopus-api";
32
41
  import { state } from "../../stores/ParamSdkStore";
33
42
  import { useGeneralStore } from "@/stores/GeneralStore";
34
43
  import { mapState } from "pinia";
@@ -47,6 +56,16 @@ export default defineComponent({
47
56
  mounted() {
48
57
  document.title = this.metaTitle;
49
58
  },
59
+ methods:{
60
+ async logoutFunction(){
61
+ try {
62
+ await octopusApi.postDataPublic(4, '/logout', undefined);
63
+ this.$router.push('/');
64
+ } catch (error) {
65
+ //Do nothing
66
+ }
67
+ }
68
+ }
50
69
  });
51
70
  </script>
52
71
  <style lang="scss">