Merge branch '309-add-weblite-identifier-to-autogenered-usernames' into 'dev'
Prefix random usernames with "weblite" See merge request keanuapp/keanuapp-weblite!107
This commit is contained in:
commit
b25b34ce26
2 changed files with 8 additions and 4 deletions
|
|
@ -389,8 +389,12 @@ class Util {
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Generate a random user name */
|
/** Generate a random user name */
|
||||||
randomUser() {
|
randomUser(prefix) {
|
||||||
return "weblite-" + this.randomString(
|
var pfx = prefix ? prefix.replace(/[^0-9a-zA-Z\-_]/gi, '') : null;
|
||||||
|
if (!pfx || pfx.length == 0) {
|
||||||
|
pfx = "weblite-";
|
||||||
|
}
|
||||||
|
return pfx + this.randomString(
|
||||||
12,
|
12,
|
||||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
|
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -115,7 +115,7 @@ export default {
|
||||||
// can not use avatars and 3. They can not seamlessly be upgraded to real accounts.
|
// can not use avatars and 3. They can not seamlessly be upgraded to real accounts.
|
||||||
//
|
//
|
||||||
// Instead, we use an ILAG approach, Improved Landing as Guest.
|
// Instead, we use an ILAG approach, Improved Landing as Guest.
|
||||||
const user = util.randomUser();
|
const user = util.randomUser(this.$config.userIdPrefix);
|
||||||
const pass = util.randomPass();
|
const pass = util.randomPass();
|
||||||
promiseLogin = tempMatrixClient
|
promiseLogin = tempMatrixClient
|
||||||
.register(user, pass, null, {
|
.register(user, pass, null, {
|
||||||
|
|
@ -854,7 +854,7 @@ export default {
|
||||||
if (tempUser) {
|
if (tempUser) {
|
||||||
clientPromise = Promise.resolve(tempUser);
|
clientPromise = Promise.resolve(tempUser);
|
||||||
} else {
|
} else {
|
||||||
const user = util.randomUser();
|
const user = util.randomUser(this.$config.userIdPrefix);
|
||||||
const pass = util.randomPass();
|
const pass = util.randomPass();
|
||||||
clientPromise = tempMatrixClient
|
clientPromise = tempMatrixClient
|
||||||
.register(user, pass, null, {
|
.register(user, pass, null, {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue