mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-23 10:41:38 +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) => {
|
||||
return setAbortable(this._platform.request(url, options));
|
||||
});
|
||||
let oidc = undefined;
|
||||
if (issuer) {
|
||||
try {
|
||||
const oidcApi = new OidcApi({
|
||||
@ -139,18 +140,16 @@ export class Client {
|
||||
crypto: this._platform.crypto,
|
||||
});
|
||||
await oidcApi.validate();
|
||||
|
||||
return {
|
||||
homeserver,
|
||||
oidc: { issuer, account },
|
||||
};
|
||||
oidc = { issuer, account }
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
const hsApi = new HomeServerApi({homeserver, request: this._platform.request});
|
||||
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