feature: Add support for V3 flow in registration process#151
Conversation
Signed-off-by: Rello <Rello@users.noreply.github.com>
Signed-off-by: Rello <Rello@users.noreply.github.com>
Signed-off-by: Rello <Rello@users.noreply.github.com>
Signed-off-by: Rello <Rello@users.noreply.github.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 88a7b6fdb7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } | ||
|
|
||
| return $this->generateTemplate($token, $email, '', $ocs !== false); | ||
| return $this->generateTemplate($token, $email, '', $ocs !== false ? (string)$ocs : ''); |
There was a problem hiding this comment.
Preserve legacy OCS flag semantics in password flow
Casting $ocs to a string here changes the existing /password/set/{email}/{token}/{ocs} behavior from a boolean “presence flag” to a value-sensitive flag, but submitPassword() still only triggers client login when ocsapirequest === '1'. As a result, legacy links that use a non-'1' segment (for example the historical ocsapirequest token) will no longer redirect to nc://login/... after password submission and will fall back to web login instead.
Useful? React with 👍 / 👎.
| <!-- Submit --> | ||
| <div id="submit-wrapper"> | ||
| <input type="hidden" value="<?php print_unescaped($_['ocsapirequest']) ?>" name="ocsapirequest"> | ||
| <input type="hidden" value="<?php print_unescaped($_['flow']) ?>" name="flow"> |
There was a problem hiding this comment.
Escape flow value before embedding in hidden input
This prints $_['flow'] unescaped into an HTML attribute. The value originates from the public route segment /password/set/{email}/{token}/flow/{flow} and can be attacker-controlled for a valid token URL, so crafted values containing quotes can break out of value="..." and inject markup/script into the page.
Useful? React with 👍 / 👎.
|
@skjnldsv |
Background
Overview
ocsapirequest(old desktop clients & mobile clients) is not touched. In this case, the Nextcloud will return anc://login/server:{server}&user:{email}&password:{appPassword}responseflow=V3, the user is logged in in the webUI and additionally, anc://login/server:{server}response is triggeredChanges to desktop
Dependent PRs: