Skip to content

Login#5

Open
Jiyu13 wants to merge 85 commits intomainfrom
login
Open

Login#5
Jiyu13 wants to merge 85 commits intomainfrom
login

Conversation

@Jiyu13
Copy link
Owner

@Jiyu13 Jiyu13 commented Aug 13, 2025

  1. finish adding dataStorage
  2. add android Access Token Logic With Retrofit OkHttp Interceptors

Jiyu13 added 30 commits July 23, 2025 12:42
- maps the JSON field created_at
- maps the JSON field item_count
- check if top bar is in ListsScreen
- check if goBackIcon is null
- Sets isLoading = true while waiting for the result.
- resets isLoading to false
- track isLoading + load lists if isLoading is true
- create SharedUsers model
- center aligned list share row
- style list share text
- show original lists if input is empty
- if not show lists filtered by input
- keep search input when done is clicked
- add rightText, right Icon param
- check if new params
- require userId + request as params
- return a ListModel object
Jiyu13 added 30 commits August 1, 2025 12:25
- user serializable object / data class to define routes
- it represents all the possible states of a login process
- login suspense contains credentials + return a custom wrapper type for either success or failure
- mutable state email and psw + validation and update function
- currentUser to hold logged-in user after login
- loginState to hold ui state
- login function to resets ui state, api call, update state
- install serializable related dependencies
- finish onLoginClick call back
- handle login state
- fetch lists with global object currentUser id
- define companion object to manage each preferences key
- add methods to save / update data with edit()
- define properties to read string type values stored on the device
- clear data from dataStore
- provideOkHttpClient to access token on every request + call refresh api to refresh token
- wire OkHttpClient into Retrofit provider
- provideDataStorageAPI to wire up dataStoreManager
- provideListifyAPI created from Retrofit
- suspend fun calls api.login
- Inject AuthUserRepository and ListifyStorageManager via Hilt
- Implement login() using Loading/Success/Error LoginState
- Persist userId/email/accessToken/refreshToken to DataStore on success
- add errorMessage mutable state
- wrap calling repository inside try/finally statement
- show error message if fails to get lists
- getUserId() reads stored userId
- isExpired(jwt) decodes the JWT payload (Base64 URL-safe) on-device and checks the exp (epoch seconds)
- checkAccessToken() gets /checks the current accessToken + refresh /save new tokens
…oken is valid

- navigate to lists screen with user id if both are true
- show auth buttons if false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant