mirror of
https://github.com/JustinZeus/Wholphin.git
synced 2026-07-08 23:51:21 +02:00
Add option to require server login for user profile (#1367)
## Description This PR adds a new method of protecting a user profile when switching to it: server login. When enabled, switching to the user requires authenticating with the server again via Quick Connect or username & password. This is basically the same as the official client. ### Related issues Closes #321 Related to #1330 - might cause merge conflicts Related to #1287 - definitely causes merge conflicts ### Testing Emulator with various uses cases including auto sign-in, switching between server login & PIN protection, and removing the protection ## Screenshots N/A, the login looks identical as adding a new user ## AI or LLM usage None
This commit is contained in:
parent
1463480e26
commit
45d466d76f
12 changed files with 813 additions and 35 deletions
|
|
@ -434,8 +434,11 @@ class MainActivityViewModel
|
|||
appUpgradeHandler.copySubfont(false)
|
||||
val prefs =
|
||||
preferences.data.firstOrNull() ?: AppPreferences.getDefaultInstance()
|
||||
val userHasPin = serverRepository.currentUser.value?.hasPin == true
|
||||
if (prefs.signInAutomatically && !userHasPin) {
|
||||
val allowAutoSignIn =
|
||||
serverRepository.currentUser.value?.let {
|
||||
!it.hasPin && !it.requireLogin
|
||||
} == true
|
||||
if (prefs.signInAutomatically && allowAutoSignIn) {
|
||||
val current =
|
||||
serverRepository.restoreSession(
|
||||
prefs.currentServerId?.toUUIDOrNull(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue