Skip to content

[18.0][FIX] webservice: reset oauth2_flow regardless of server_environment - #161

Merged
OCA-git-bot merged 1 commit into
OCA:18.0from
camptocamp:18.0-fix-oauth2-flow-reset
Sep 1, 2026
Merged

[18.0][FIX] webservice: reset oauth2_flow regardless of server_environment#161
OCA-git-bot merged 1 commit into
OCA:18.0from
camptocamp:18.0-fix-oauth2-flow-reset

Conversation

@simahawk

Copy link
Copy Markdown
Contributor

#146 split server_environment out of webservice into the optional webservice_server_env module, but the logic resetting oauth2_flow when auth_type is no longer "oauth2" only lived in webservice_server_env's _compute_server_env override.

Without server_environment installed, switching a backend's auth_type away from "oauth2" (via the UI or a plain write) silently left a stale oauth2_flow, which _get_adapter_protocol would then still factor into the selected component.

Add an _onchange_auth_type plus create/write overrides on webservice.backend itself so the reset is guaranteed unconditionally, independent of server_environment. webservice_server_env's own override is unchanged and still covers its own case (env-var-driven values).

CC @yankinmax @gurneyalex

@yankinmax yankinmax left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I see, thank you @simahawk
Just a question: will we FW and BKP this commit as a separate PR or do you want me just to include it in existing PR's splitting the server_environment?

@simahawk

simahawk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

FTR build red for unrelated reason #162

@simahawk

simahawk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

I see, thank you @simahawk Just a question: will we FW and BKP this commit as a separate PR or do you want me just to include it in existing PR's splitting the server_environment?

You can already include the commit in your pending PRs.

@yankinmax

Copy link
Copy Markdown
Contributor

You can already include the commit in your pending PRs.

ok, I'll include it

PR#146 split server_environment out of `webservice` into the optional
`webservice_server_env` module, but the logic resetting `oauth2_flow`
when `auth_type` is no longer "oauth2" only lived in
`webservice_server_env`'s `_compute_server_env` override.

Without `server_environment` installed, switching a backend's
`auth_type` away from "oauth2" (via the UI or a plain write) silently
left a stale `oauth2_flow`, which `_get_adapter_protocol` would then
still factor into the selected component.

Add an `_onchange_auth_type` plus `create`/`write` overrides on
`webservice.backend` itself so the reset is guaranteed unconditionally,
independent of `server_environment`. `webservice_server_env`'s own
override is unchanged and still covers its own case (env-var-driven
values).
@simahawk
simahawk force-pushed the 18.0-fix-oauth2-flow-reset branch from 94740fb to d8d9de5 Compare September 1, 2026 08:01
@simahawk

simahawk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

/ocabot merge patch

@OCA-git-bot

Copy link
Copy Markdown
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 18.0-ocabot-merge-pr-161-by-simahawk-bump-patch, awaiting test results.

@OCA-git-bot
OCA-git-bot merged commit 4bf21ec into OCA:18.0 Sep 1, 2026
7 checks passed
@OCA-git-bot

Copy link
Copy Markdown
Contributor

Congratulations, your PR was merged at f416d15. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants