feat: skip password prompts for W3DS-logged sessions - #14
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #13.
Summary
W3DS sessions now skip Nextcloud's password-confirmation prompt entirely (server-side middleware + client-side modal), and the mandatory post-login password-setup screen is gone.
AuthController::completeLogin()stampsIToken::SCOPE_SKIP_PASSWORD_VALIDATIONandIToken::SCOPE_FILESYSTEMon the session token right aftercreateSessionToken(), mirroring how core handles SSO logins inOC_User::loginWithApache(). The middleware reads the scope and returns early;JSConfigHelper::canUserValidatePassword()reads the same scope and emitswindow.backendAllowsPasswordConfirmation = false, which makes@nextcloud/password-confirmationshort-circuit before the modal can spawn.The whole password-setup pathway (
PasswordSetupController,password-setup.phptemplate,password-gate.js, the redirect gate inBeforeTemplateRenderedListener, the two routes) is removed. The provisioning marker is renamedmust_set_password->provisionedand the orphan-sweep inDedupeMappingsCommand::sweepOrphans()follows it. ApostSchemaChangemigration renames any existing rows inoc_preferences.min-versionbumped to 30 (where the scope constants land). App version bumped to 0.7.0.Why
W3DS users authenticate cryptographically; they have no password to confirm. The previous workaround (force every new user to invent a password they would never use) was the wrong shape and contradicted the passwordless premise the app advertises.
Test plan
/directly, no password-setup intermediate pagewindow.backendAllowsPasswordConfirmation === falsefor a W3DS sessionmust_set_password='1'inoc_preferences: after migration, row isprovisioned='1'and they log straight into/occ w3ds_login:dedupe-mappings --dry-runstill detects orphan provisioned-but-unmapped users after the rename