mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-02-02 15:41:41 +01:00
add loginMethod along with oidc in queryLogin
This commit is contained in:
parent
7ba2f26624
commit
59853ebf11
@ -130,6 +130,7 @@ export class Client {
|
|||||||
const { homeserver, issuer, account } = await lookupHomeserver(initialHomeserver, (url, options) => {
|
const { homeserver, issuer, account } = await lookupHomeserver(initialHomeserver, (url, options) => {
|
||||||
return setAbortable(this._platform.request(url, options));
|
return setAbortable(this._platform.request(url, options));
|
||||||
});
|
});
|
||||||
|
let oidc = undefined;
|
||||||
if (issuer) {
|
if (issuer) {
|
||||||
try {
|
try {
|
||||||
const oidcApi = new OidcApi({
|
const oidcApi = new OidcApi({
|
||||||
@ -139,18 +140,16 @@ export class Client {
|
|||||||
crypto: this._platform.crypto,
|
crypto: this._platform.crypto,
|
||||||
});
|
});
|
||||||
await oidcApi.validate();
|
await oidcApi.validate();
|
||||||
|
oidc = { issuer, account }
|
||||||
return {
|
|
||||||
homeserver,
|
|
||||||
oidc: { issuer, account },
|
|
||||||
};
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const hsApi = new HomeServerApi({homeserver, request: this._platform.request});
|
const hsApi = new HomeServerApi({homeserver, request: this._platform.request});
|
||||||
const response = await setAbortable(hsApi.getLoginFlows()).response();
|
const response = await setAbortable(hsApi.getLoginFlows()).response();
|
||||||
return this._parseLoginOptions(response, homeserver);
|
const result = this._parseLoginOptions(response, homeserver);
|
||||||
|
result.oidc = oidc;
|
||||||
|
return result;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user