mirror of
https://github.com/we-promise/sure.git
synced 2026-04-18 11:34:13 +00:00
Check for pending invitations before creating new Family during SSO log in/sign up (#1171)
* Check for pending invitations before creating new Family during SSO account creation When a user signs in via Google SSO and doesn't have an account yet, the system now checks for pending invitations before creating a new Family. If an invitation exists, the user joins the invited family instead. - OidcAccountsController: check Invitation.pending in link/create_user - API AuthController: check pending invitations in sso_create_account - SessionsController: pass has_pending_invitation to mobile SSO callback - Web view: show "Accept Invitation" button when invitation exists - Flutter: show "Accept Invitation" tab/button when invitation pending https://claude.ai/code/session_019Tr6edJa496V1ErGmsbqFU * Fix external assistant tests: clear Settings cache to prevent test pollution The tests relied solely on with_env_overrides to clear configuration, but rails-settings-cached may retain stale Setting values across tests when the cache isn't explicitly invalidated. Ensure both ENV vars AND Setting values are cleared with Setting.clear_cache before assertions. https://claude.ai/code/session_019Tr6edJa496V1ErGmsbqFU --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -210,6 +210,9 @@ class Settings::HostingsControllerTest < ActionDispatch::IntegrationTest
|
||||
delete disconnect_external_assistant_settings_hosting_url
|
||||
|
||||
assert_redirected_to settings_hosting_url
|
||||
# Force cache refresh so configured? reads fresh DB state after
|
||||
# the disconnect action cleared the settings within its own request.
|
||||
Setting.clear_cache
|
||||
assert_not Assistant::External.configured?
|
||||
assert_equal "builtin", users(:family_admin).family.reload.assistant_type
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user