[Client] Fix openid method

This commit is contained in:
Christian Pauly 2020-01-13 11:52:42 +00:00
parent 62bbec0918
commit 27da3041b4
2 changed files with 8 additions and 8 deletions

View file

@ -1056,7 +1056,7 @@ class Client {
/// The generated token is only valid for exchanging for user information from the federation API for OpenID.
Future<OpenIdCredentials> requestOpenIdCredentials() async {
final Map<String, dynamic> response = await jsonRequest(
type: HTTPType.GET,
type: HTTPType.POST,
action: "/client/r0/user/$userID/openid/request_token");
return OpenIdCredentials.fromJson(response);
}

View file

@ -522,13 +522,6 @@ class FakeMatrixApi extends MockClient {
static final Map<String, Map<String, dynamic>> api = {
"GET": {
"/client/r0/user/@test:fakeServer.notExisting/openid/request_token":
(var req) => {
"access_token": "SomeT0kenHere",
"token_type": "Bearer",
"matrix_server_name": "example.com",
"expires_in": 3600
},
"/client/r0/rooms/1/state/m.room.member/@alice:example.com": (var req) =>
{"displayname": "Alice"},
"/client/r0/profile/@getme:example.com": (var req) => {
@ -761,6 +754,13 @@ class FakeMatrixApi extends MockClient {
(var req) => syncResponse,
},
"POST": {
"/client/r0/user/@test:fakeServer.notExisting/openid/request_token":
(var req) => {
"access_token": "SomeT0kenHere",
"token_type": "Bearer",
"matrix_server_name": "example.com",
"expires_in": 3600
},
"/client/r0/login": (var req) => {
"user_id": "@test:fakeServer.notExisting",
"access_token": "abc123",