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> <script>
import User from "../models/user"; import User from "../models/user";
import util from "../plugins/utils";
export default { export default {
name: "Login", name: "Login",
@ -75,7 +76,7 @@ export default {
}, },
created() { created() {
if (this.loggedIn) { 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: { watch: {
@ -120,7 +121,7 @@ export default {
this.loading = true; this.loading = true;
this.$store.dispatch("auth/login", user).then( 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) => { (error) => {
this.loading = false; this.loading = false;

View file

@ -16,6 +16,8 @@
</template> </template>
<script> <script>
import util from "../plugins/utils";
export default { export default {
name: "RoomList", name: "RoomList",
@ -26,7 +28,7 @@ export default {
watch: { watch: {
currentRoomId() { currentRoomId() {
this.$emit("close"); 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);
}, },
}, },
}; };