Commit 6e118cc
authored
Bug Fix: Fix change passcode and logout functionality (#64)
* Integrate Koin for dependency injection and refactor PasscodeManager
* Implement Koin dependency injection across Android, iOS, Desktop, and Web sample modules.
* Introduce `passcodeModule` and `initKoin` to manage dependencies for `PasscodeManager`, `PasscodeStorageAdapter`, and ViewModels.
* Refactor `SampleAppNavigation` and `App.kt` to use `koinInject()` and `koinViewModel()` instead of manual dependency passing.
* Update `PasscodeManager` to use `MutableStateFlow.update` for thread-safe state mutations and ensure proper state clearing during initialization and deletion.
* Enhance `PasscodeManager` to automatically save new passcodes to the adapter upon successful confirmation.
* Update `libs.versions.toml` with Koin and KSP dependencies and apply necessary plugins in `build.gradle.kts`.
* Initialize Koin in platform-specific entry points (`SampleApplication`, `MainViewController.kt`, `main.kt`).
* Update passcode actions and handling in navigation and passcode manager
* Refactor `PasscodeAction` by renaming `DeletePasscode` to `ForgetPasscode` and adding `LogOutErasePasscode`.
* Update `PasscodeManager` to handle the new `LogOutErasePasscode` action by invoking `adapter.deletePasscode()` and handle `ForgetPasscode` instead of the former `DeletePasscode`.
* Update `SampleAppNavigation` to inject `PasscodeStorageAdapter` and use `PasscodeAction.LogOutErasePasscode` for session clearing.
* Update `PasscodeScreen` to use `PasscodeAction.ForgetPasscode` when the forgot button is clicked.
* Clean up unused imports and update PasscodeModule header
* Removed unused imports in `SampleAppNavigation.kt`, `SampleApplication.kt`, and `App.kt`.
* Added license header to `PasscodeModule.kt`.
* Applied minor formatting fixes, including trailing commas and whitespace cleanup in `SampleAppNavigation.kt`, `SampleApplication.kt`, `PasscodeModule.kt`, and `PasscodeManager.kt`.
* Update dependency information in module READMEs
* Updated the installation instructions in `mifos-authenticator-biometrics/README.md` to specify the full dependency notation `io.github.openmf:mifos-authenticator-passcode` and simplified the code examples.
* Updated the prerequisites in `mifos-authenticator-passcode/README.md` to use the full Maven coordinate `io.github.openmf:mifos-authenticator-passcode`.
* Rename authentication composition providers and locals
* Renamed `LibraryLocalCompositionProvider` to `PlatformAuthenticatorLocalCompositionProvider` across all platforms (Android, iOS, Desktop, JS, WasmJS).
* Renamed `libraryLocalPlatformAuthenticationProvider` to `platformAuthenticationProvider`.
* Renamed `libraryPlatformAvailableAuthenticationOption` to `platformAvailableAuthenticationOption`.
* Updated references in `App.kt`, `ChooseAuthOptionScreen.kt`, and `AuthenticationScreen.kt` to reflect the new names.1 parent 81157b0 commit 6e118cc
25 files changed
Lines changed: 198 additions & 123 deletions
File tree
- build-logic/convention/src/main/kotlin
- cmp-sample-android
- src/main/kotlin/cmp/sample/android
- cmp-sample-desktop/src/desktopMain/kotlin/cmp/sample/desktop
- cmp-sample-ios/src/iosMain/kotlin/cmp/sample/ios
- cmp-sample-web/src
- jsMain/kotlin/cmp/sample/js
- wasmJsMain/kotlin/cmp/sample/wasmJs
- gradle
- mifos-authenticator-biometrics
- src
- androidMain/kotlin/org/mifos/authenticator/biometrics
- commonMain/kotlin/org/mifos/authenticator/biometrics
- desktopMain/kotlin/org/mifos/authenticator/biometrics
- iosMain/kotlin/org/mifos/authenticator/biometrics
- jsMain/kotlin/org/mifos/authenticator/biometrics
- wasmJsMain/kotlin/org/mifos/authenticator/biometrics
- mifos-authenticator-passcode
- src/commonMain/kotlin/org/mifos/authenticator/passcode
- screen
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
Lines changed: 13 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
13 | 16 | | |
14 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
32 | 39 | | |
33 | 40 | | |
34 | 41 | | |
Lines changed: 3 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | | - | |
16 | 14 | | |
17 | | - | |
18 | | - | |
19 | | - | |
| 15 | + | |
20 | 16 | | |
21 | 17 | | |
22 | 18 | | |
23 | | - | |
| 19 | + | |
24 | 20 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 21 | + | |
44 | 22 | | |
45 | 23 | | |
46 | 24 | | |
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
53 | 55 | | |
| 56 | + | |
54 | 57 | | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
58 | | - | |
| 61 | + | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| |||
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
67 | | - | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
187 | 191 | | |
188 | 192 | | |
189 | 193 | | |
| 194 | + | |
190 | 195 | | |
191 | 196 | | |
192 | 197 | | |
| |||
Lines changed: 43 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
0 commit comments