Implemented network-based authentication and secure token storage
- Replaced mock login logic in `LoginViewModel` with actual API calls using Retrofit. - Integrated `EncryptedSharedPreferences` via a new `TokenStorage` class to securely persist access and refresh tokens. - Added `RetrofitProvider` and `APIService` to handle network requests and JSON serialization. - Updated `Account` entity and database schema (version 2) to include user roles, enabling destructive migration for development. - Added necessary internet permissions and allowed cleartext traffic in `AndroidManifest.xml`. - Included dependencies for Retrofit, OkHttp logging, and AndroidX Security.
This commit is contained in:
@@ -65,4 +65,12 @@ dependencies {
|
||||
val room_version = "2.8.4"
|
||||
implementation("androidx.room:room-runtime:$room_version")
|
||||
ksp("androidx.room:room-compiler:$room_version")
|
||||
|
||||
// Retrofit + Gson
|
||||
implementation("com.squareup.retrofit2:retrofit:2.9.0")
|
||||
implementation("com.squareup.retrofit2:converter-gson:2.9.0")
|
||||
// OkHttp logging (debug)
|
||||
implementation("com.squareup.okhttp3:logging-interceptor:4.9.3")
|
||||
// AndroidX Security (EncryptedSharedPreferences)
|
||||
implementation("androidx.security:security-crypto:1.1.0-alpha03")
|
||||
}
|
||||
Reference in New Issue
Block a user