Encode room ids

Issue #39.
This commit is contained in:
N-Pex 2021-02-01 16:04:12 +01:00
parent bcde25336f
commit 947fea9bb7
2 changed files with 6 additions and 3 deletions

View file

@ -49,6 +49,7 @@
<script>
import User from "../models/user";
import util from "../plugins/utils";
export default {
name: "Login",
@ -75,7 +76,7 @@ export default {
},
created() {
if (this.loggedIn) {
this.$navigation.push({name: "Chat", params: { roomId: this.$matrix.currentRoomId }}, -1);
this.$navigation.push({name: "Chat", params: { roomId: util.sanitizeRoomId(this.$matrix.currentRoomId) }}, -1);
}
},
watch: {
@ -120,7 +121,7 @@ export default {
this.loading = true;
this.$store.dispatch("auth/login", user).then(
() => {
this.$navigation.push({name: "Chat", params: { roomId: this.$matrix.currentRoomId }}, -1);
this.$navigation.push({name: "Chat", params: { roomId: util.sanitizeRoomId(this.$matrix.currentRoomId) }}, -1);
},
(error) => {
this.loading = false;

View file

@ -16,6 +16,8 @@
</template>
<script>
import util from "../plugins/utils";
export default {
name: "RoomList",
@ -26,7 +28,7 @@ export default {
watch: {
currentRoomId() {
this.$emit("close");
this.$navigation.push({name: 'Chat', params: { roomId: this.currentRoomId }}, -1);
this.$navigation.push({name: 'Chat', params: { roomId: util.sanitizeRoomId(this.currentRoomId) }}, -1);
},
},
};