diff --git a/src/components/Login.vue b/src/components/Login.vue index 8825173..e6b2631 100644 --- a/src/components/Login.vue +++ b/src/components/Login.vue @@ -111,8 +111,17 @@ export default { methods: { handleLogin() { if (this.user.username && this.user.password) { + + // 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(':')) { + const parts = user.username.split(":"); + user.username = parts[0].substring(1); + user.server = "https://" + parts[1]; + } + this.loading = true; - this.$store.dispatch("auth/login", this.user).then( + this.$store.dispatch("auth/login", user).then( () => { this.$navigation.push({name: "Chat", params: { roomId: this.$matrix.currentRoomId }}, -1); },