Compare commits
2 Commits
82ff813225
...
4569930a81
| Author | SHA1 | Date |
|---|---|---|
|
|
4569930a81 | |
|
|
52b012402e |
|
|
@ -1,11 +1,11 @@
|
||||||
{
|
{
|
||||||
"name": "traxxx-web",
|
"name": "traxxx-web",
|
||||||
"version": "0.43.0",
|
"version": "0.43.1",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"version": "0.43.0",
|
"version": "0.43.1",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@brillout/json-serializer": "^0.5.8",
|
"@brillout/json-serializer": "^0.5.8",
|
||||||
"@dicebear/collection": "^7.0.5",
|
"@dicebear/collection": "^7.0.5",
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@
|
||||||
"overrides": {
|
"overrides": {
|
||||||
"vite": "$vite"
|
"vite": "$vite"
|
||||||
},
|
},
|
||||||
"version": "0.43.0",
|
"version": "0.43.1",
|
||||||
"imports": {
|
"imports": {
|
||||||
"#/*": "./*.js"
|
"#/*": "./*.js"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,7 +70,10 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button class="button button-submit">Log in</button>
|
<button
|
||||||
|
class="button button-submit"
|
||||||
|
:disabled="submitted"
|
||||||
|
>Log in</button>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
v-if="allowSignup"
|
v-if="allowSignup"
|
||||||
|
|
@ -94,11 +97,13 @@ const allowSignup = pageContext.env.allowSignup;
|
||||||
const username = ref('');
|
const username = ref('');
|
||||||
const password = ref('');
|
const password = ref('');
|
||||||
|
|
||||||
|
const submitted = ref(false);
|
||||||
const errorMsg = ref(null);
|
const errorMsg = ref(null);
|
||||||
const userInput = ref(null);
|
const userInput = ref(null);
|
||||||
const showPassword = ref(false);
|
const showPassword = ref(false);
|
||||||
|
|
||||||
async function login() {
|
async function login() {
|
||||||
|
submitted.value = true;
|
||||||
errorMsg.value = null;
|
errorMsg.value = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
@ -111,6 +116,8 @@ async function login() {
|
||||||
navigate(pageContext.urlParsed.search.r ? decodeURIComponent(pageContext.urlParsed.search.r) : `/user/${loginUser.username}`, null, { redirect: true });
|
navigate(pageContext.urlParsed.search.r ? decodeURIComponent(pageContext.urlParsed.search.r) : `/user/${loginUser.username}`, null, { redirect: true });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
errorMsg.value = error.message;
|
errorMsg.value = error.message;
|
||||||
|
} finally {
|
||||||
|
submitted.value = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -120,7 +120,10 @@
|
||||||
@expired="captcha = null"
|
@expired="captcha = null"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<button class="button button-submit">Sign up</button>
|
<button
|
||||||
|
class="button button-submit"
|
||||||
|
:disabled="submitted"
|
||||||
|
>Sign up</button>
|
||||||
|
|
||||||
<a
|
<a
|
||||||
href="/login"
|
href="/login"
|
||||||
|
|
@ -146,24 +149,24 @@ const password = ref('');
|
||||||
const passwordConfirm = ref('');
|
const passwordConfirm = ref('');
|
||||||
|
|
||||||
const errorMsg = ref(null);
|
const errorMsg = ref(null);
|
||||||
|
const submitted = ref(false);
|
||||||
const userInput = ref(null);
|
const userInput = ref(null);
|
||||||
const showPassword = ref(false);
|
const showPassword = ref(false);
|
||||||
const captcha = ref(null);
|
const captcha = ref(null);
|
||||||
|
|
||||||
async function signup() {
|
async function signup() {
|
||||||
errorMsg.value = null;
|
errorMsg.value = null;
|
||||||
|
submitted.value = true;
|
||||||
|
|
||||||
if (password.value !== passwordConfirm.value) {
|
if (password.value !== passwordConfirm.value) {
|
||||||
errorMsg.value = 'Passwords do not match';
|
errorMsg.value = 'Passwords do not match';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
if (env.captcha.enabled && !captcha.value) {
|
if (env.captcha.enabled && !captcha.value) {
|
||||||
errorMsg.value = 'Please complete the CAPTCHA';
|
errorMsg.value = 'Please complete the CAPTCHA';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const newUser = await post('/users', {
|
const newUser = await post('/users', {
|
||||||
|
|
@ -177,6 +180,8 @@ async function signup() {
|
||||||
navigate(`/user/${newUser.username}`, null, { redirect: true });
|
navigate(`/user/${newUser.username}`, null, { redirect: true });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
errorMsg.value = error.message;
|
errorMsg.value = error.message;
|
||||||
|
} finally {
|
||||||
|
submitted.value = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue