@enso-ui/auth 2.0.8 → 2.0.12

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/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import PasswordStrength from './src/bulma/pages/auth/components/PasswordStrength.vue';
2
+
3
+ export { PasswordStrength };
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@enso-ui/auth",
3
- "version": "2.0.8",
3
+ "version": "2.0.12",
4
4
  "description": "UI auth package",
5
- "main": "src/bulma/pages/auth/Index.vue",
5
+ "main": "index.js",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
@@ -11,8 +11,8 @@
11
11
  </template>
12
12
 
13
13
  <script>
14
- import CoreAuth from '../../core/layouts/Auth.vue';
15
14
  import Router from '@enso-ui/ui/src/bulma/pages/Router.vue';
15
+ import CoreAuth from '../../core/layouts/Auth.vue';
16
16
 
17
17
  export default {
18
18
  name: 'Auth',
@@ -52,14 +52,10 @@ export default {
52
52
  methods: {
53
53
  ...mapMutations('auth', ['login']),
54
54
  ...mapMutations('layout', ['home']),
55
- ...mapMutations(['setShowQuote', 'setCsrfToken']),
56
- init(data) {
55
+ ...mapMutations(['setShowQuote']),
56
+ init() {
57
57
  this.setShowQuote(this.meta.showQuote);
58
58
 
59
- if (data.csrfToken) {
60
- this.setCsrfToken(data.csrfToken);
61
- }
62
-
63
59
  setTimeout(() => {
64
60
  this.login();
65
61
  this.home(true);
@@ -1,5 +1,6 @@
1
1
  <template>
2
- <div class="login">
2
+ <div class="login"
3
+ :class="$attrs.class">
3
4
  <div class="box p-3">
4
5
  <div class="logo mb-3 is-flex">
5
6
  <figure class="image is-48x48 is-clickable is-flex"
@@ -29,6 +30,15 @@ export default {
29
30
 
30
31
  inject: ['routerErrorHandler'],
31
32
 
33
+ provide() {
34
+ return {
35
+ state: this.state,
36
+ errors: this.errors,
37
+ };
38
+ },
39
+
40
+ inheritAttrs: false,
41
+
32
42
  data: () => ({
33
43
  errors: new Errors(),
34
44
  state: {
@@ -39,13 +49,6 @@ export default {
39
49
  computed: {
40
50
  ...mapState(['meta']),
41
51
  },
42
-
43
- provide() {
44
- return {
45
- state: this.state,
46
- errors: this.errors,
47
- };
48
- },
49
52
  };
50
53
  </script>
51
54
 
@@ -23,7 +23,7 @@ export default {
23
23
 
24
24
  components: { Fa },
25
25
 
26
- inject: ['errors', 'i18n', 'route', 'state', 'toastr'],
26
+ inject: ['errors', 'http', 'i18n', 'route', 'state', 'toastr'],
27
27
 
28
28
  props: {
29
29
  action: {
@@ -65,7 +65,7 @@ export default {
65
65
  this.state.successful = false;
66
66
  this.$emit('submitting');
67
67
 
68
- axios.post(this.route(this.endpoint), this.payload, this.config)
68
+ this.http.post(this.route(this.endpoint), this.payload, this.config)
69
69
  .then(({ data }) => {
70
70
  this.state.successful = true;
71
71
  this.$emit('success', data);
@@ -30,11 +30,13 @@ import Confirmation from '../components/fields/Confirmation.vue';
30
30
  export default {
31
31
  name: 'Reset',
32
32
 
33
- components: { AuthForm, Email, PasswordStrength, Password, Confirmation },
33
+ components: {
34
+ AuthForm, Email, PasswordStrength, Password, Confirmation,
35
+ },
34
36
 
35
37
  inject: ['routerErrorHandler'],
36
38
 
37
- data: (v) => ({
39
+ data: v => ({
38
40
  payload: {
39
41
  email: '',
40
42
  password: '',
package/src/store/auth.js CHANGED
@@ -1,3 +1,4 @@
1
+ import axios from 'axios';
1
2
  import router from '@enso-ui/ui/src/core/services/router';
2
3
 
3
4
  export const state = {