From 9d514206ca4b087713f1891bf6368201875fdd8d Mon Sep 17 00:00:00 2001 From: m1k1o Date: Sat, 3 Apr 2021 22:00:32 +0200 Subject: [PATCH] auto user login. --- README.md | 1 + client/src/components/connect.vue | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a389e29..74a4e08 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,7 @@ For n.eko room management software visit https://github.com/m1k1o/neko-rooms. - Added `m1k1o/neko:xfce` tag, as an non video related showcase (by @mbattista). - Added ARM-based images, for Raspberry Pi support (by @mbattista). - Added simple language picker. +- Added `?usr=` that will prefill username. This allows creating auto-join links. ### Bugs - Fixed minor gst pipeline bug. diff --git a/client/src/components/connect.vue b/client/src/components/connect.vue index ab52357..db3308b 100644 --- a/client/src/components/connect.vue +++ b/client/src/components/connect.vue @@ -157,14 +157,23 @@ private password: string = '' mounted() { + // auto-password fill let password = this.$accessor.password if (this.autoPassword !== null) { this.removeUrlParam('pwd') password = this.autoPassword } - if (this.$accessor.displayname !== '' && password !== '') { - this.$accessor.login({ displayname: this.$accessor.displayname, password }) + // auto-user fill + let displayname = this.$accessor.displayname + const usr = new URL(location.href).searchParams.get('usr') + if (usr) { + this.removeUrlParam('usr') + displayname = this.$accessor.displayname || usr + } + + if (displayname !== '' && password !== '') { + this.$accessor.login({ displayname, password }) this.autoPassword = null } }