Work on profile and login

This commit is contained in:
N-Pex 2021-01-21 16:31:37 +01:00
parent 2708e58161
commit 4dac049664
4 changed files with 114 additions and 25 deletions

View file

@ -5,7 +5,7 @@
</v-btn>
<div color="rgba(255,255,255,0.1)" class="text-center">
<h4>Login</h4>
<div class="h2">Login</div>
<v-form v-model="isValid">
<v-text-field
v-model="user.username"
@ -90,19 +90,17 @@ export default {
message() {
if (
this.message &&
this.message.message &&
this.message.message.toLowerCase().includes("user")
this.message.toLowerCase().includes("user")
) {
this.userErrorMessage = this.message.message;
this.userErrorMessage = this.message;
} else {
this.userErrorMessage = null;
}
if (
this.message &&
this.message.message &&
this.message.message.toLowerCase().includes("pass")
this.message.toLowerCase().includes("pass")
) {
this.passErrorMessage = this.message.message;
this.passErrorMessage = this.message;
} else {
this.passErrorMessage = null;
}
@ -112,6 +110,9 @@ export default {
handleLogin() {
if (this.user.username && this.user.password) {
// Reset errors
this.message = null;
// Is it a full matrix user id? Modify a copy, so that the UI will still show the full ID.
var user = Object.assign({}, this.user);
if (user.username.startsWith('@') && user.username.includes(':')) {
@ -128,9 +129,10 @@ export default {
(error) => {
this.loading = false;
this.message =
(error.response && error.response.data) ||
(error.data && error.data.error) ||
error.message ||
error.toString();
console.log("Message set to ", this.message);
}
);
}