Get dm link
This commit is contained in:
parent
0795c25654
commit
00f95adb09
14 changed files with 422 additions and 26 deletions
|
|
@ -113,7 +113,7 @@ export default {
|
|||
console.log("create crypto store");
|
||||
return new LocalStorageCryptoStore(this.$store.getters.storage);
|
||||
},
|
||||
login(user, registrationFlowHandler) {
|
||||
login(user, registrationFlowHandler, createUser = false) {
|
||||
const tempMatrixClient = sdk.createClient({baseUrl: user.home_server, idBaseUrl: this.$config.identityServer});
|
||||
var promiseLogin;
|
||||
|
||||
|
|
@ -121,14 +121,14 @@ export default {
|
|||
if (user.access_token) {
|
||||
// Logged in on "real" account
|
||||
promiseLogin = Promise.resolve(user);
|
||||
} else if (user.is_guest && (!user.user_id || user.registration_session)) {
|
||||
} else if (createUser || (user.is_guest && (!user.user_id || user.registration_session))) {
|
||||
// Generate random username and password. We don't user REAL matrix
|
||||
// guest accounts because 1. They are not allowed to post media, 2. They
|
||||
// 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.
|
||||
const userId = user.registration_session ? user.user_id : util.randomUser(this.$config.userIdPrefix);
|
||||
const pass = user.registration_session ? user.password : util.randomPass();
|
||||
const userId = (createUser || user.registration_session) ? user.user_id : util.randomUser(this.$config.userIdPrefix);
|
||||
const pass = (createUser || user.registration_session) ? user.password : util.randomPass();
|
||||
|
||||
const extractAndSaveUser = (response) => {
|
||||
var u = Object.assign({}, response);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue