Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(logout): Keep user signed in #111

Merged
merged 8 commits into from
Jan 4, 2023

Conversation

krizzu
Copy link

@krizzu krizzu commented Dec 21, 2022

📑 What does this PR do?

As part of #107, navigate user to sign in flow once authenticated.

For now, the auth status does not redirect to Timeline (waiting for #107), otherwise we might get stuck.

Things done:

  • Desktop DB implementation saves data to disk, instead of memory
  • Added AuthState model, to reflect the authorization state for user
  • Moved Root to root module, moved Splash to splash module
  • Added Turbine for testing flows

✅ Checklist

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

🧪 How can this PR been tested?

🧾 Tasks Remaining: (List of tasks remaining to be implemented)

  • Use case to control auth state, exposed via flow

🖼️ Screenshots (if applicable):

@krizzu krizzu marked this pull request as ready for review January 4, 2023 11:56
@thebino thebino merged commit 1f33a41 into AndroidDev-social:main Jan 4, 2023
@krizzu krizzu deleted the feat/logout branch January 4, 2023 12:50
Comment on lines +38 to +47
private val _authState = MutableStateFlow<AuthStatus?>(null)
override val authState = _authState.asStateFlow()

init {
viewModelScope.launch {
getAuthStatus().collect { currentStatus ->
_authState.value = currentStatus
}
}
}
Copy link
Member

@crocsandcoffee crocsandcoffee Jan 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not just inline?

    override val authState = getAuthStatus().stateIn(scope, ...., null)

@krizzu krizzu mentioned this pull request Jan 5, 2023
4 tasks
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.

4 participants