@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.
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +15 -17
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +24 -26
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +28 -30
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +78 -79
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +30 -32
- package/dist/prometheus-framework/src/modules/auth/localization/EnterCode.json.cjs +1 -0
- package/dist/prometheus-framework/src/modules/auth/localization/EnterCode.json.js +20 -0
- package/dist/prometheus-framework/src/modules/auth/localization/EnterPassword.json.cjs +1 -0
- package/dist/prometheus-framework/src/modules/auth/localization/EnterPassword.json.js +26 -0
- package/dist/prometheus-framework/src/modules/auth/localization/ResetPassword.json.cjs +1 -0
- package/dist/prometheus-framework/src/modules/auth/localization/ResetPassword.json.js +30 -0
- package/dist/prometheus-framework/src/modules/auth/localization/SignIn.json.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/localization/SignIn.json.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/localization/SignUp.json.cjs +1 -0
- package/dist/prometheus-framework/src/modules/auth/localization/SignUp.json.js +32 -0
- package/dist/prometheus-framework/src/modules/auth/router/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/router/auth.js +114 -111
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/modules/auth/components/pages/EnterCode.vue +4 -4
- package/src/modules/auth/components/pages/EnterPassword.vue +3 -4
- package/src/modules/auth/components/pages/ResetPassword.vue +4 -5
- package/src/modules/auth/components/pages/SignIn.vue +12 -10
- package/src/modules/auth/components/pages/SignUp.vue +4 -5
- package/src/modules/auth/localization/EnterCode.json +13 -11
- package/src/modules/auth/localization/EnterPassword.json +19 -17
- package/src/modules/auth/localization/ResetPassword.json +23 -21
- package/src/modules/auth/localization/SignIn.json +1 -1
- package/src/modules/auth/localization/SignUp.json +25 -23
- package/src/modules/auth/router/auth.js +95 -86
- 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
|
-
|
164
|
-
|
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:
|
172
|
+
clientId: 'com.thecommune.app.signin',
|
171
173
|
scope: 'email name',
|
172
|
-
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
|
-
"
|
3
|
-
"
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
"
|
10
|
-
|
11
|
-
|
12
|
-
|
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
|
-
"
|
3
|
-
"
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
"
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
-
"
|
3
|
-
"
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
"
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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,26 +1,28 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
"
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
"
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
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
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
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: '
|
27
|
-
ru: '
|
13
|
+
en: 'Аутентификация',
|
14
|
+
ru: 'Authentication'
|
28
15
|
},
|
16
|
+
options: options
|
29
17
|
},
|
30
|
-
component:
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
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
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
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
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
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
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
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
|
-
|
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
|
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
|
}
|