@ozdao/prometheus-framework 0.1.79 → 0.1.81

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
  2. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +15 -17
  3. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
  4. package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +24 -26
  5. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
  6. package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +28 -30
  7. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
  8. package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +78 -79
  9. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
  10. package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +30 -32
  11. package/dist/prometheus-framework/src/modules/auth/localization/EnterCode.json.cjs +1 -0
  12. package/dist/prometheus-framework/src/modules/auth/localization/EnterCode.json.js +20 -0
  13. package/dist/prometheus-framework/src/modules/auth/localization/EnterPassword.json.cjs +1 -0
  14. package/dist/prometheus-framework/src/modules/auth/localization/EnterPassword.json.js +26 -0
  15. package/dist/prometheus-framework/src/modules/auth/localization/ResetPassword.json.cjs +1 -0
  16. package/dist/prometheus-framework/src/modules/auth/localization/ResetPassword.json.js +30 -0
  17. package/dist/prometheus-framework/src/modules/auth/localization/SignIn.json.cjs +1 -1
  18. package/dist/prometheus-framework/src/modules/auth/localization/SignIn.json.js +1 -1
  19. package/dist/prometheus-framework/src/modules/auth/localization/SignUp.json.cjs +1 -0
  20. package/dist/prometheus-framework/src/modules/auth/localization/SignUp.json.js +32 -0
  21. package/dist/prometheus-framework/src/modules/auth/router/auth.cjs +1 -1
  22. package/dist/prometheus-framework/src/modules/auth/router/auth.js +114 -111
  23. package/dist/style.css +1 -1
  24. package/package.json +1 -1
  25. package/src/modules/auth/components/pages/EnterCode.vue +4 -4
  26. package/src/modules/auth/components/pages/EnterPassword.vue +3 -4
  27. package/src/modules/auth/components/pages/ResetPassword.vue +4 -5
  28. package/src/modules/auth/components/pages/SignIn.vue +12 -10
  29. package/src/modules/auth/components/pages/SignUp.vue +4 -5
  30. package/src/modules/auth/localization/EnterCode.json +13 -11
  31. package/src/modules/auth/localization/EnterPassword.json +19 -17
  32. package/src/modules/auth/localization/ResetPassword.json +23 -21
  33. package/src/modules/auth/localization/SignIn.json +1 -1
  34. package/src/modules/auth/localization/SignUp.json +25 -23
  35. package/src/modules/auth/router/auth.js +95 -86
  36. package/src/modules/middlewares/client/inputs.validation.js +1 -0
@@ -1,15 +1,15 @@
1
1
  <template>
2
2
  <section class="">
3
3
  <!-- Header -->
4
- <img :src="'/logo/logo_square.svg'" class="i-extra mn-small">
4
+ <img :src="'/logo/logo_square.svg'" class="i-extra radius-small mn-small">
5
5
 
6
6
  <h3 class="mn-medium">
7
7
  {{ t('title') }}
8
8
  <br>
9
9
  <span class="t-semi">{{ t('subtitle') }}</span>
10
10
  </h3>
11
+
11
12
  <p class="mn-big">
12
-
13
13
  <router-link :to="{name: 'Sign Up'}" class="underline t-second">{{ t('signup') }}</router-link>
14
14
  </p>
15
15
 
@@ -25,7 +25,7 @@
25
25
  </div>
26
26
 
27
27
  <!-- Form -->
28
- <div class="">
28
+ <div class="pos-relative">
29
29
  <!-- Phone -->
30
30
  <transition name="slide-fade">
31
31
  <div v-show="tabAuth === 'phone'" class="mn-thin radius-small">
@@ -124,9 +124,6 @@ const router = useRouter()
124
124
  const { t } = useI18n(text)
125
125
  // Accessing state
126
126
  const tabAuth = ref('phone')
127
- // OUATH ENV
128
- const clientId = inject('APPLE_CLIENTID')
129
- const redirectURI = inject('APPLE_REDIRECT_URL')
130
127
 
131
128
  const loadExternalScript = (src) => {
132
129
  return new Promise((resolve, reject) => {
@@ -160,16 +157,21 @@ async function onSubmit() {
160
157
  } catch (error) {
161
158
  throw new Error
162
159
  }
163
- auth.state.user.phone = auth.state.user.phone.number
164
- await auth.actions.login(auth.state.user, tabAuth.value)
160
+
161
+ // COSTIL PLEASE GOD MAKE IT GOOD, FUKEN INPUT COMPONENT RETURN OBJECT NUT NUMBER
162
+ const userCopy = {...auth.state.user};
163
+ userCopy.phone = auth.state.user.phone.number
164
+ // COSTIL PLEASE GOD MAKE IT GOOD, FUKEN INPUT COMPONENT RETURN OBJECT NUT NUMBER
165
+
166
+ await auth.actions.login(userCopy, tabAuth.value)
165
167
  }
166
168
 
167
169
  async function onSubmitApple() {
168
170
  try {
169
171
  window.AppleID.auth.init({
170
- clientId: clientId,
172
+ clientId: 'com.thecommune.app.signin',
171
173
  scope: 'email name',
172
- redirectURI: redirectURI,
174
+ redirectURI: 'https://thecommunephuket.com/auth/signin',
173
175
  usePopup: true,
174
176
  });
175
177
 
@@ -17,7 +17,7 @@
17
17
  </div>
18
18
 
19
19
  <!-- Form -->
20
- <div class="">
20
+ <div class="pos-relative">
21
21
  <!-- Phone -->
22
22
  <transition name="slide-fade">
23
23
  <div v-show="tabAuth === 'phone'" class="mn-semi radius-small">
@@ -71,16 +71,15 @@
71
71
  import { computed, onMounted, ref } from 'vue'
72
72
  import { useRoute, useRouter } from 'vue-router'
73
73
  import { useI18n } from 'vue-i18n'
74
+ // Import localization
75
+ import text from '@pf/src/modules/auth/localization/SignUp.json'
74
76
  // Import state
75
77
  import * as auth from '@pf/src/modules/auth/store/auth'
76
78
  import * as twofa from '@pf/src/modules/auth/store/twofa'
77
79
  // Import validation
78
80
  import * as inputsValidation from '@pf/src/modules/middlewares/client/inputs.validation'
79
81
  // Localization
80
- const { t } = useI18n({
81
- inheritLocale: true,
82
- useScope: 'local'
83
- })
82
+ const { t } = useI18n(text)
84
83
  // Validation
85
84
  const phoneValidation = ref(null)
86
85
  const emailValidation = ref(null)
@@ -1,14 +1,16 @@
1
1
  {
2
- "en": {
3
- "verifyNumberTitle": "Verify Number",
4
- "instructions": "We have sent a registration code to your phone number. Please enter it in the field below:",
5
- "resendCode": "Send the code again",
6
- "secondsResend": "seconds to the possibility of sending the code again."
7
- },
8
- "ru": {
9
- "verifyNumberTitle": "Подтвердите номер",
10
- "instructions": "Мы отправили код регистрации на ваш номер телефона. Введите его в поле ниже:",
11
- "resendCode": "Отправить код еще раз",
12
- "secondsResend": "секунд до возможности отправить код еще раз."
2
+ "messages": {
3
+ "en": {
4
+ "verifyNumberTitle": "Verify Number",
5
+ "instructions": "We have sent a registration code to your phone number. Please enter it in the field below:",
6
+ "resendCode": "Send the code again",
7
+ "secondsResend": "seconds to the possibility of sending the code again."
8
+ },
9
+ "ru": {
10
+ "verifyNumberTitle": "Подтвердите номер",
11
+ "instructions": "Мы отправили код регистрации на ваш номер телефона. Введите его в поле ниже:",
12
+ "resendCode": "Отправить код еще раз",
13
+ "secondsResend": "секунд до возможности отправить код еще раз."
14
+ }
13
15
  }
14
16
  }
@@ -1,20 +1,22 @@
1
1
  {
2
- "en": {
3
- "almostDone": "Almost there!",
4
- "newPasswordPrompt": "Please, set a new password.",
5
- "registrationPasswordPrompt": "Please, set your password to complete the registration.",
6
- "passwordPlaceholder": "Password",
7
- "repeatPasswordPlaceholder": "Repeat Password",
8
- "changePasswordBtn": "Change Password",
9
- "registerBtn": "Register"
10
- },
11
- "ru": {
12
- "almostDone": "Почти все!",
13
- "newPasswordPrompt": "Пожалуйста, укажите новый пароль.",
14
- "registrationPasswordPrompt": "Пожалуйста, укажите пароль, на этом регистрация будет закончена.",
15
- "passwordPlaceholder": "Пароль",
16
- "repeatPasswordPlaceholder": "Повторите пароль",
17
- "changePasswordBtn": "Поменять пароль",
18
- "registerBtn": "Зарегистрироваться"
2
+ "messages": {
3
+ "en": {
4
+ "almostDone": "Almost there!",
5
+ "newPasswordPrompt": "Please, set a new password.",
6
+ "registrationPasswordPrompt": "Please, set your password to complete the registration.",
7
+ "passwordPlaceholder": "Password",
8
+ "repeatPasswordPlaceholder": "Repeat Password",
9
+ "changePasswordBtn": "Change Password",
10
+ "registerBtn": "Register"
11
+ },
12
+ "ru": {
13
+ "almostDone": "Почти все!",
14
+ "newPasswordPrompt": "Пожалуйста, укажите новый пароль.",
15
+ "registrationPasswordPrompt": "Пожалуйста, укажите пароль, на этом регистрация будет закончена.",
16
+ "passwordPlaceholder": "Пароль",
17
+ "repeatPasswordPlaceholder": "Повторите пароль",
18
+ "changePasswordBtn": "Поменять пароль",
19
+ "registerBtn": "Зарегистрироваться"
20
+ }
19
21
  }
20
22
  }
@@ -1,24 +1,26 @@
1
1
  {
2
- "en": {
3
- "forgotPasswordTitle": "Forgot Password?",
4
- "instructions": "To reset your password, specify the phone or email used during registration.",
5
- "smsInfo": "We will send you an SMS with a confirmation code to reset your password, which you will need to enter in the next step.",
6
- "emailInfo": "We will send you an email with a confirmation code to reset your password, which you will need to enter in the next step.",
7
- "phone": "Phone",
8
- "email": "Email",
9
- "phonePlaceholder": "Enter your phone",
10
- "emailPlaceholder": "Enter your email",
11
- "sendCode": "Send code"
12
- },
13
- "ru": {
14
- "forgotPasswordTitle": "Забыли пароль?",
15
- "instructions": "Чтобы сбросить пароль, укажите телефон или email, использованные при регистрации.",
16
- "smsInfo": "Мы вышлем вам SMS с кодом подтверждения для сброса пароля, который вы должны будете ввести в следующем шаге.",
17
- "emailInfo": "Мы отправим вам электронное письмо с кодом подтверждения для сброса пароля, который вы должны будете ввести в следующем шаге.",
18
- "phone": "Телефон",
19
- "email": "Email",
20
- "phonePlaceholder": "Введите ваш телефон",
21
- "emailPlaceholder": "Введите ваш email",
22
- "sendCode": "Отправить код"
2
+ "messages": {
3
+ "en": {
4
+ "forgotPasswordTitle": "Forgot Password?",
5
+ "instructions": "To reset your password, specify the phone or email used during registration.",
6
+ "smsInfo": "We will send you an SMS with a confirmation code to reset your password, which you will need to enter in the next step.",
7
+ "emailInfo": "We will send you an email with a confirmation code to reset your password, which you will need to enter in the next step.",
8
+ "phone": "Phone",
9
+ "email": "Email",
10
+ "phonePlaceholder": "Enter your phone",
11
+ "emailPlaceholder": "Enter your email",
12
+ "sendCode": "Send code"
13
+ },
14
+ "ru": {
15
+ "forgotPasswordTitle": "Забыли пароль?",
16
+ "instructions": "Чтобы сбросить пароль, укажите телефон или email, использованные при регистрации.",
17
+ "smsInfo": "Мы вышлем вам SMS с кодом подтверждения для сброса пароля, который вы должны будете ввести в следующем шаге.",
18
+ "emailInfo": "Мы отправим вам электронное письмо с кодом подтверждения для сброса пароля, который вы должны будете ввести в следующем шаге.",
19
+ "phone": "Телефон",
20
+ "email": "Email",
21
+ "phonePlaceholder": "Введите ваш телефон",
22
+ "emailPlaceholder": "Введите ваш email",
23
+ "sendCode": "Отправить код"
24
+ }
23
25
  }
24
26
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "messages": {
3
3
  "en": {
4
- "title": "Welcome to Weeder",
4
+ "title": "Welcome to The Commune",
5
5
  "subtitle": "Sign In to Continue",
6
6
  "signup": "Don't have an account?",
7
7
  "phone": "Phone",
@@ -1,26 +1,28 @@
1
1
  {
2
- "en": {
3
- "title": "Sign Up to The Commune",
4
- "description": "Choose a convenient way to register via phone or email:",
5
- "phone": "Phone",
6
- "email": "Email",
7
- "phonePlaceholder": "Enter your phone",
8
- "emailPlaceholder": "Enter your email",
9
- "emailNotice": "We will send you an email with a confirmation code that you will need to enter in the next step.",
10
- "smsNotice": "We will send you an SMS with a confirmation code that you will need to enter in the next step.",
11
- "sendCode": "Send Code",
12
- "haveAccount": "Already have an account?"
13
- },
14
- "ru": {
15
- "title": "Новая учетная запись",
16
- "description": "Выберите удобный способ регистрации через телефон или email:",
17
- "phone": "Телефон",
18
- "email": "Email",
19
- "phonePlaceholder": "Введите ваш телефон",
20
- "emailPlaceholder": "Введите ваш email",
21
- "emailNotice": "Мы отправим вам электронное письмо с кодом подтверждения, который вы должны будете ввести в следующем шаге.",
22
- "smsNotice": "Мы вышлем вам SMS с кодом подтверждения, который вы должны будете ввести в следующем шаге.",
23
- "sendCode": "Отправить код",
24
- "haveAccount": "У вас уже есть аккаунт?"
2
+ "messages": {
3
+ "en": {
4
+ "title": "Sign Up to The Commune",
5
+ "description": "Choose a convenient way to register via phone or email:",
6
+ "phone": "Phone",
7
+ "email": "Email",
8
+ "phonePlaceholder": "Enter your phone",
9
+ "emailPlaceholder": "Enter your email",
10
+ "emailNotice": "We will send you an email with a confirmation code that you will need to enter in the next step.",
11
+ "smsNotice": "We will send you an SMS with a confirmation code that you will need to enter in the next step.",
12
+ "sendCode": "Send Code",
13
+ "haveAccount": "Already have an account?"
14
+ },
15
+ "ru": {
16
+ "title": "Новая учетная запись",
17
+ "description": "Выберите удобный способ регистрации через телефон или email:",
18
+ "phone": "Телефон",
19
+ "email": "Email",
20
+ "phonePlaceholder": "Введите ваш телефон",
21
+ "emailPlaceholder": "Введите ваш email",
22
+ "emailNotice": "Мы отправим вам электронное письмо с кодом подтверждения, который вы должны будете ввести в следующем шаге.",
23
+ "smsNotice": "Мы вышлем вам SMS с кодом подтверждения, который вы должны будете ввести в следующем шаге.",
24
+ "sendCode": "Отправить код",
25
+ "haveAccount": "У вас уже есть аккаунт?"
26
+ }
25
27
  }
26
28
  }
@@ -3,99 +3,108 @@ import layoutAuth from '../components/layouts/Auth.vue'
3
3
  import * as validationState from '@pf/src/modules/middlewares/client/states.validation.js'
4
4
  import * as validationAuth from '@pf/src/modules/middlewares/client/auth.validation.js';
5
5
 
6
- const auth = [
7
- {
8
- path: 'auth',
9
- name: 'Authentication',
10
- meta: {
11
- title: {
12
- en: 'Sign In',
13
- ru: 'Вход'
14
- },
15
- },
16
- component: layoutAuth,
17
- children: [{
18
- path: 'signin',
19
- name: 'Sign In',
20
- beforeEnter: [
21
- validationAuth.requiresNoAuth,
22
- validationState.resetUser
23
- ],
6
+ function createAuthRoutes (options) {
7
+ const auth = [
8
+ {
9
+ path: 'auth',
10
+ name: 'Authentication',
24
11
  meta: {
25
12
  title: {
26
- en: 'Sign In',
27
- ru: 'Вход'
13
+ en: 'Аутентификация',
14
+ ru: 'Authentication'
28
15
  },
16
+ options: options
29
17
  },
30
- component: () => import(/* webpackChunkName: "signin" */ '../components/pages/SignIn.vue'),
31
- },{
32
- path: 'reset-password',
33
- name: 'Reset Password',
34
- beforeEnter: [
35
- validationAuth.requiresNoAuth,
36
- validationState.resetUser
37
- ],
38
- meta: {
39
- title: {
40
- en: 'Reset Password',
41
- ru: 'Сбросить Пароль'
18
+ component: layoutAuth,
19
+ children: [{
20
+ path: 'signin',
21
+ name: 'Sign In',
22
+ beforeEnter: [
23
+ validationAuth.requiresNoAuth,
24
+ validationState.resetUser
25
+ ],
26
+ meta: {
27
+ title: {
28
+ en: 'Sign In',
29
+ ru: 'Вход'
30
+ },
42
31
  },
43
- },
44
- component: () => import(/* webpackChunkName: "reset-password" */ '../components/pages/ResetPassword.vue'),
45
- },{
46
- path: 'signup',
47
- name: 'Sign Up',
48
- beforeEnter: [
49
- validationAuth.requiresNoAuth,
50
- validationState.resetUser
51
- ],
52
- meta: {
53
- title: {
54
- en: 'Sign Up',
55
- ru: 'Регистрация'
32
+ component: () => import(
33
+ /* webpackChunkName: "signin" */
34
+ '../components/pages/SignIn.vue'
35
+ ),
36
+ },{
37
+ path: 'reset-password',
38
+ name: 'Reset Password',
39
+ beforeEnter: [
40
+ validationAuth.requiresNoAuth,
41
+ validationState.resetUser
42
+ ],
43
+ meta: {
44
+ title: {
45
+ en: 'Reset Password',
46
+ ru: 'Сбросить Пароль'
47
+ },
56
48
  },
57
- },
58
- component: () => import(/* webpackChunkName: "signup" */ '../components/pages/SignUp.vue'),
59
- },{
60
- path: 'enter-code',
61
- name: 'Enter Code',
62
- beforeEnter: [
63
- validationAuth.requiresNoAuth,
64
- validationState.checkUser
65
- ],
66
- meta: {
67
- title: {
68
- en: 'Enter Code',
69
- ru: 'Введите Код'
49
+ component: () => import(/* webpackChunkName: "reset-password" */ '../components/pages/ResetPassword.vue'),
50
+ },{
51
+ path: 'signup',
52
+ name: 'Sign Up',
53
+ beforeEnter: [
54
+ validationAuth.requiresNoAuth,
55
+ validationState.resetUser
56
+ ],
57
+ meta: {
58
+ title: {
59
+ en: 'Sign Up',
60
+ ru: 'Регистрация'
61
+ },
70
62
  },
71
- },
72
- component: () => import(/* webpackChunkName: "signup" */ '../components/pages/EnterCode.vue'),
73
- },{
74
- path: 'enter-password',
75
- name: 'Enter Password',
76
- beforeEnter: [
77
- validationAuth.requiresNoAuth,
78
- validationState.checkUser
79
- ],
80
- meta: {
81
- title: {
82
- en: 'Enter Password',
83
- ru: 'Введите Пароль'
63
+ component: () => import(/* webpackChunkName: "signup" */ '../components/pages/SignUp.vue'),
64
+ },{
65
+ path: 'enter-code',
66
+ name: 'Enter Code',
67
+ beforeEnter: [
68
+ validationAuth.requiresNoAuth,
69
+ validationState.checkUser
70
+ ],
71
+ meta: {
72
+ title: {
73
+ en: 'Enter Code',
74
+ ru: 'Введите Код'
75
+ },
84
76
  },
85
- },
86
- component: () => import(/* webpackChunkName: "signup" */ '../components/pages/EnterPassword.vue'),
87
- },{
88
- path: 'invite',
89
- name: 'Invite',
90
- meta: {
91
- title: {
92
- en: 'Invite',
93
- ru: 'Приглашение'
77
+ component: () => import(/* webpackChunkName: "signup" */ '../components/pages/EnterCode.vue'),
78
+ },{
79
+ path: 'enter-password',
80
+ name: 'Enter Password',
81
+ beforeEnter: [
82
+ validationAuth.requiresNoAuth,
83
+ validationState.checkUser
84
+ ],
85
+ meta: {
86
+ title: {
87
+ en: 'Enter Password',
88
+ ru: 'Введите Пароль'
89
+ },
94
90
  },
95
- },
96
- component: () => import(/* webpackChunkName: "signup" */ '../components/pages/Invite.vue'),
97
- }],
98
- },
99
- ];
91
+ component: () => import(/* webpackChunkName: "signup" */ '../components/pages/EnterPassword.vue'),
92
+ },{
93
+ path: 'invite',
94
+ name: 'Invite',
95
+ meta: {
96
+ title: {
97
+ en: 'Invite',
98
+ ru: 'Приглашение'
99
+ },
100
+ },
101
+ component: () => import(/* webpackChunkName: "signup" */ '../components/pages/Invite.vue'),
102
+ }],
103
+ },
104
+ ];
105
+
106
+ return auth
107
+ }
108
+
100
109
 
101
- export default auth;
110
+ export default createAuthRoutes;
@@ -146,6 +146,7 @@ async function validateInputs(input, method, variable, message) {
146
146
  status: false,
147
147
  message: i18n.global.t("validation.length")
148
148
  }
149
+
149
150
  setTimeout(() => { input.value = null }, 3000);
150
151
  throw new Error(i18n.global.t("validation.length"));
151
152
  }