|
|
@ -22,11 +22,12 @@
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
import textbtn from '@/components/textbtn';
|
|
|
|
import textbtn from '@/components/textbtn';
|
|
|
|
import {matrix} from '@/main.js';
|
|
|
|
import {matrix} from '@/main.js';
|
|
|
|
import {cookieHandler} from "@/lib/cookieHandler";
|
|
|
|
import {cookieHandler} from '@/lib/cookieHandler';
|
|
|
|
import ThrobberOverlay from "@/components/throbberOverlay";
|
|
|
|
import ThrobberOverlay from '@/components/throbberOverlay';
|
|
|
|
|
|
|
|
import {isValidUserId} from '@/lib/matrixUtils';
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
name: "login.vue",
|
|
|
|
name: 'login.vue',
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
ThrobberOverlay,
|
|
|
|
ThrobberOverlay,
|
|
|
|
textbtn
|
|
|
|
textbtn
|
|
|
@ -42,7 +43,7 @@ export default {
|
|
|
|
} if (this.password === '') {
|
|
|
|
} if (this.password === '') {
|
|
|
|
this.loginError = 'password is empty';
|
|
|
|
this.loginError = 'password is empty';
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
} if (!(this.user.match(/^@[a-zA-Z0-9_.+-]+:[a-z0-9.-]+\.[a-z]+$/))) {
|
|
|
|
} if (!isValidUserId(this.user)) {
|
|
|
|
this.loginError = 'username is in wrong style';
|
|
|
|
this.loginError = 'username is in wrong style';
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -83,10 +84,10 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data(){
|
|
|
|
data(){
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
user: "",
|
|
|
|
user: '',
|
|
|
|
password: "",
|
|
|
|
password: '',
|
|
|
|
homeServer: "https://adb.sh",
|
|
|
|
homeServer: 'https://adb.sh',
|
|
|
|
loginError: "",
|
|
|
|
loginError: '',
|
|
|
|
cookie: new cookieHandler(),
|
|
|
|
cookie: new cookieHandler(),
|
|
|
|
loading: false
|
|
|
|
loading: false
|
|
|
|
}
|
|
|
|
}
|
|
|
|