Skip to content

Fix Devise 5 compatibility: replace deprecated positional scope in sign_in#273

Closed
antonzaytsev wants to merge 2 commits intosolidusio:mainfrom
antonzaytsev:devise-5-compat
Closed

Fix Devise 5 compatibility: replace deprecated positional scope in sign_in#273
antonzaytsev wants to merge 2 commits intosolidusio:mainfrom
antonzaytsev:devise-5-compat

Conversation

@antonzaytsev
Copy link
Copy Markdown

Summary

Fixes Devise 5.x runtime compatibility by replacing the deprecated positional scope argument in sign_in and bumping the gem version to 2.6.1.

What changed

  1. sign_in(:spree_user, resource)sign_in(resource) in UserRegistrationsController#create

    Devise 5 removed the deprecated sign_in(scope, resource) form. The scope is inferred automatically from the resource's class mapping (Spree::User:spree_user), so the explicit scope argument is unnecessary and causes a runtime error with Devise >= 5.0.

  2. Version bump to 2.6.1

Why this matters

The gemspec already allows Devise 5.x (>= 4.1), but the code-level incompatibility causes a ArgumentError during user registration when running with Devise 5. This is the only Devise 5 incompatibility in the codebase — all other deprecated patterns (sign_in(:bypass), devise_error_messages!, Devise::TestHelpers, deliver) were already updated in previous releases.

Context

CVE-2026-32700 affects Devise < 5.0.3 (email confirmation race condition). Downstream Solidus apps cannot upgrade to the patched Devise version without this fix. See also #271.

Backwards compatible

sign_in(resource) works identically on Devise 4.x and 5.x — Devise has inferred scopes from resource class mappings since 4.0. No behavior change for existing installations.

Checklist

Devise 5 removed the deprecated `sign_in(scope, resource)` form.
Use `sign_in(resource)` instead — Devise infers the scope from
the resource's class mapping automatically.

This fixes a runtime error when using solidus_auth_devise with
Devise >= 5.0 during user registration.
@antonzaytsev
Copy link
Copy Markdown
Author

Closing — 2.6.0 was just released with devise 5.x support already included.

@antonzaytsev antonzaytsev deleted the devise-5-compat branch April 8, 2026 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant