mirror of https://github.com/vector-im/riot-web
Merge pull request #3602 from matrix-org/travis/fix-identity-register
Match identity server registration to the IS r0.3.0 specpull/21833/head
commit
59dccb86ba
|
@ -183,8 +183,10 @@ export default class IdentityAuthClient {
|
||||||
async registerForToken(check=true) {
|
async registerForToken(check=true) {
|
||||||
try {
|
try {
|
||||||
const hsOpenIdToken = await MatrixClientPeg.get().getOpenIdToken();
|
const hsOpenIdToken = await MatrixClientPeg.get().getOpenIdToken();
|
||||||
const { access_token: identityAccessToken } =
|
// XXX: The spec is `token`, but we used `access_token` for a Sydent release.
|
||||||
|
const { access_token: accessToken, token } =
|
||||||
await this._matrixClient.registerWithIdentityServer(hsOpenIdToken);
|
await this._matrixClient.registerWithIdentityServer(hsOpenIdToken);
|
||||||
|
const identityAccessToken = token ? token : accessToken;
|
||||||
if (check) await this._checkToken(identityAccessToken);
|
if (check) await this._checkToken(identityAccessToken);
|
||||||
return identityAccessToken;
|
return identityAccessToken;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue