chatwoot/spec/controllers/devise
Shivam Mishra 211fb1102d
chore: rotate oauth password if unconfirmed (#13878)
When a user signs up with an email they don't own and sets a password,
that password remains valid even after the real owner later signs in via
OAuth. This means the original registrant — who never proved ownership
of the email — retains working credentials on the account. This change
closes that gap by rotating the password to a random value whenever an
unconfirmed user completes an OAuth sign-in.

The check (`oauth_user_needs_password_reset?`) is evaluated before
`skip_confirmation!` runs, since confirmation would flip `confirmed_at`
and mask the condition. If the user was unconfirmed, the stored password
is replaced with a secure random string that satisfies the password
policy. This applies to both the web and mobile OAuth callback paths, as
well as the sign-up path where the password is rotated before the reset
token is generated.

Users who lose access to password-based login as a side effect can
recover through the standard "Forgot password" flow at any time. Since
they've already proven email ownership via OAuth, this is a low-friction
recovery path
2026-04-02 11:26:29 +05:30
..
confirmations_controller_spec.rb chore: Update dependencies to the latest versions (#5033) 2022-07-15 09:51:59 +07:00
omniauth_callbacks_controller_spec.rb chore: rotate oauth password if unconfirmed (#13878) 2026-04-02 11:26:29 +05:30
session_controller_spec.rb fix: Remove user.permissions, resolve it from accounts (#9990) 2024-08-21 11:36:26 +05:30
token_validations_controller_spec.rb Chore: Render avatar url in validate token method (#448) 2020-01-27 00:59:51 +05:45