Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
chore: pass string to login method instead of LoginType for OIDC adda…
Browse files Browse the repository at this point in the history
…ptation
  • Loading branch information
mrmcoding88 committed Dec 26, 2023
1 parent 150d5db commit c4763a6
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ from [matrix-spec](https://github.com/matrix-org/matrix-spec/).
To regenerate the code, follow these steps:

1. Clone both repositories next to each other
1.1 `git clone git@gitlab.com:famedly/company/frontend/dart_openapi_codegen.git`
1.2 `git clone git@gitlab.com:famedly/company/frontend/libraries/matrix_api_lite.git`
1.1 `git clone git@github.com:famedly/dart_openapi_codegen.git`
1.2 `git clone git@github.com:famedly/dart_matrix_api_lite.git`
2. Execute the script in the dart_openapi_codegen directory:
```sh
cd dart_openapi_codegen
./scripts/matrix.sh ../matrix_api_lite/lib/src/generated
./scripts/matrix.sh ../dart_matrix_api_lite/lib/src/generated
cd ..
```
3. Run the build_runner in the matrix_api_lite directory:
```sh
cd matrix_api_lite
cd dart_matrix_api_lite
dart pub get
dart run build_runner build
```
Expand Down
4 changes: 2 additions & 2 deletions lib/src/generated/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1905,7 +1905,7 @@ class Api {
/// [type] The login type being used.
///
/// [user] The fully qualified user ID or just local part of the user ID, to log in. Deprecated in favour of `identifier`.
Future<LoginResponse> login(LoginType type,
Future<LoginResponse> login(String type,
{String? address,
String? deviceId,
AuthenticationIdentifier? identifier,
Expand All @@ -1928,7 +1928,7 @@ class Api {
if (password != null) 'password': password,
if (refreshToken != null) 'refresh_token': refreshToken,
if (token != null) 'token': token,
'type': type.name,
'type': type,
if (user != null) 'user': user,
}));
final response = await httpClient.send(request);
Expand Down
8 changes: 3 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ dev_dependencies:
import_sorter: ^4.6.0
lints: ^2.0.0
test: ^1.14.4

dependency_overrides:
# uncomment for local development
# matrix:
# path: '../famedlysdk'
# dependency_overrides: # uncomment for local development
# matrix:
# path: "../matrix-dart-sdk"
2 changes: 1 addition & 1 deletion test/matrix_api_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void main() {
test('login', () async {
matrixApi.homeserver = Uri.parse('https://fakeserver.notexisting');
final loginResponse = await matrixApi.login(
LoginType.mLoginPassword,
LoginType.mLoginPassword.name,
identifier: AuthenticationUserIdentifier(user: 'username'),
);
expect(FakeMatrixApi.api['POST']!['/client/v3/login']!.call(emptyRequest),
Expand Down

0 comments on commit c4763a6

Please sign in to comment.