mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 15:50:16 +02:00
Ignore auto sign in if user has PIN (#392)
If the current user has a PIN, the sign in automatically setting is ignored if the app is put in the background or restarted. Follow up to #356 & https://github.com/damontecres/Wholphin/issues/321#issuecomment-3621312496 I think the PIN protection needs some more thought overall.
This commit is contained in:
parent
e0d50baf15
commit
fa141adc60
3 changed files with 7 additions and 3 deletions
|
|
@ -179,7 +179,7 @@ class MainActivity : AppCompatActivity() {
|
|||
} else {
|
||||
DisposableEffect(Unit) {
|
||||
onDispose {
|
||||
if (!appPreferences.signInAutomatically) {
|
||||
if (!appPreferences.signInAutomatically || current?.user?.hasPin == true) {
|
||||
serverRepository.closeSession()
|
||||
}
|
||||
}
|
||||
|
|
@ -252,7 +252,7 @@ class MainActivity : AppCompatActivity() {
|
|||
val signInAutomatically =
|
||||
runBlocking { userPreferencesDataStore.data.firstOrNull()?.signInAutomatically } ?: true
|
||||
Timber.i("onRestart: signInAutomatically=$signInAutomatically")
|
||||
if (!signInAutomatically) {
|
||||
if (!signInAutomatically || serverRepository.currentUser.value?.hasPin == true) {
|
||||
serverRepository.closeSession()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue