mirror of https://github.com/vector-im/riot-web
Merge pull request #104 from matrix-org/dbkr/dedup_client_secret
Remove generateClientSecret and use the one the js sdk gives us.pull/21833/head
commit
33bd6e2028
|
@ -35,7 +35,7 @@ class PasswordReset {
|
||||||
baseUrl: homeserverUrl,
|
baseUrl: homeserverUrl,
|
||||||
idBaseUrl: identityUrl
|
idBaseUrl: identityUrl
|
||||||
});
|
});
|
||||||
this.clientSecret = generateClientSecret();
|
this.clientSecret = this.client.generateClientSecret();
|
||||||
this.identityServerDomain = identityUrl.split("://")[1];
|
this.identityServerDomain = identityUrl.split("://")[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -89,16 +89,4 @@ class PasswordReset {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// from Angular SDK
|
|
||||||
function generateClientSecret() {
|
|
||||||
var ret = "";
|
|
||||||
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
||||||
|
|
||||||
for (var i = 0; i < 32; i++) {
|
|
||||||
ret += chars.charAt(Math.floor(Math.random() * chars.length));
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = PasswordReset;
|
module.exports = PasswordReset;
|
||||||
|
|
Loading…
Reference in New Issue