Commit Graph

3908 Commits

Author SHA1 Message Date
Vasiliy Ermolovich
dce20b78f5 Merge pull request #5732 from heartcombo/fix-format
Fix passing of format option to devise_for call.
2024-11-25 14:47:44 +00:00
Vasiliy Ermolovich
46c2c3913e Fix passing of format option to devise_for call. 2024-11-25 15:40:37 +01:00
Vasiliy Ermolovich
7eccc91f61 Merge pull request #5731 from heartcombo/fix-without-mailer-load
Fix Zeitwerk autoloading when ActionMailer is not present.
2024-11-25 12:57:51 +00:00
Vasiliy Ermolovich
af112a2f65 Fix Zeitwerk autoloading when ActionMailer is not present.
When ActionMailer is not defined we have empty app/mailers/devise/mailer.rb file and Zeitwerk doesn't
like that and errors with

```
expected file app/mailers/devise/mailer.rb to define constant Devise::Mailer
```

The fix is to tell Zeitwerk to ignore that file if ActionMailer constant if not defined.

I tried to write a spec for it but since specs are run in the same process it's hard to have two
Rails applications where one of them has ActionMailer define and the seconds one doesn't.
2024-11-25 13:57:07 +01:00
Vasiliy Ermolovich
90a3fa8599 Merge pull request #5730 from jeromedalbert/fix-ci
Fix Rails main CI
2024-11-25 07:37:25 +00:00
Jerome Dalbert
950721d6de Fix Rails 8 CI 2024-11-24 18:28:09 -08:00
Vasiliy Ermolovich
591b03a6c0 Merge pull request #5728 from heartcombo/lazy-routes-fix
Make Devise.mappings work with lazy loaded routes.
2024-11-24 15:27:27 +00:00
Vasiliy Ermolovich
24c47140e5 Make Devise.mappings work with lazy loaded routes.
Starting from Rails 8.0, routes are lazy-loaded by default in test and development environments.
However, Devise's mappings are built during the routes loading phase.
To ensure it works correctly, we need to load the routes first before accessing @@mappings.
2024-11-24 16:20:26 +01:00
Vasiliy Ermolovich
0f514f1413 Merge pull request #5514 from itay-grudev/master
Bug Fix: Devise Checkbox TRUE VALUES not compatible with HTML specs (missing "on" value)
2024-11-08 16:40:12 +00:00
Itay Grudev
12f0dd1608 Bug Fix: Devise Checkbox TRUE VALUES not compatible with HTML specs (missing "on" value)
See:
* https://html.spec.whatwg.org/multipage/input.html#checkbox-state-(type%3Dcheckbox)
* https://html.spec.whatwg.org/multipage/input.html#dom-input-value-default-on

This issue causes the remember me functionality not to work correctly, especially when overriding the default styles as check boxes by default in all major browsers send the value `on` as required by the HTML specifications.

See also:

https://stackoverflow.com/questions/5987075/devise-remember-me-not-working-localhost-issue
2024-11-08 18:13:05 +02:00
Vasiliy Ermolovich
12c796e499 Merge pull request #5719 from kazuyainoue0124/fix_typos_in_readme
Remove unnecessary closing parenthesis in README [ci skip]
2024-10-22 18:49:08 +00:00
Vasiliy Ermolovich
baf0d8eff2 Update CHANGELOG.md 2024-10-22 20:45:41 +02:00
Vasiliy Ermolovich
5b15bbee7a Merge pull request #5645 from BroiSatse/main
Removed now obsolete SecretKeyFinder
2024-10-22 18:33:18 +00:00
Kazuya INOUE
25f806e270 Remove unnecessary closing parenthesis in README 2024-10-06 23:14:48 +09:00
Vasiliy Ermolovich
72884642f5 Merge pull request #5706 from abr-storm/main
Rails 8: Update route registration to use keyword arguments
2024-08-18 09:20:19 +00:00
Alex Brook
54e4b267a5 splat keyword arguments when registering routes 2024-08-17 17:34:36 +01:00
Vasiliy Ermolovich
0a2505ee23 Merge pull request #5708 from jeromedalbert/fix-ci-rails-main
Rails 8: Fix CI sqlite3 error for Gemfile-rails-main
2024-08-17 09:58:10 +00:00
Jerome Dalbert
1d859b5db0 Fix CI sqlite3 error for Gemfile-rails-main 2024-08-17 01:25:06 -07:00
Carlos Antonio da Silva
a259ff3c28 Make it clearer that we're targeting a v5 going forward
Use a "beta" version to make that even more explicit.
2024-04-10 09:45:08 -03:00
Carlos Antonio da Silva
9a7176f727 Cleanup changelog, point to 4-stable branch for previous changes
main is targetting a v5 with some possible breaking changes, for main
it's mainly dropping support for older Ruby/Rails versions, but more
might come.

[ci skip]
2024-04-10 09:43:27 -03:00
Carlos Antonio da Silva
21deb5c145 Bump year [ci skip] 2024-04-09 16:58:24 -03:00
Carlos Antonio da Silva
6ee12d1521 Merge pull request #5668 from berkos/update-ci
Adds Ruby 3.3 to CI
2024-04-09 14:20:06 -03:00
Antonis Berkakis
c80026d955 Update CI to run to include Ruby 3.3
- Exclude Rubies >=3.1 from latest main Gemfile as it runs on 7.2
2024-04-09 14:56:07 +01:00
Artin Boghosian
bb18f4d380 Update mapping.rb (#5673)
Fix grammar on comment for .find_scope! [ci skip]
2024-02-13 09:22:46 -03:00
Stanislaw Klajn
b6d64ba525 Removed now obsolete SecretKeyFinder 2023-10-26 10:41:52 +01:00
Carlos Antonio da Silva
e2242a95f3 Merge pull request #5641 from henryaj/patch-1
Fix README anchor link
2023-10-13 11:56:48 -03:00
Henry Stanley
c4578d3240 Fix README anchor link
Fixes link to Active Job Integration in README.
2023-10-13 15:54:36 +01:00
Carlos Antonio da Silva
5667ceaa1e Merge pull request #5600 from heartcombo/rm-drop-support-to-old-rubies-and-rails
Drop support to EOL rubies and Rails
2023-10-13 11:23:18 -03:00
Carlos Antonio da Silva
4d18d81311 Respect locale set by controller in the failure app (#5567)
A common usage of I18n with different locales is to create some around
callback in the application controller that sets the locale for the
entire action, via params/url/user/etc., which ensure the locale is
respected for the duration of that action, and resets at the end.

Devise was not respecting the locale when the authenticate failed and
triggered the failure app, because that happens in a warden middleware
right up in the change, by that time the controller around callback had
already reset the locale back to its default, and the failure app would
just translate flash messages using the default locale.

Now we are passing the current locale down to the failure app via warden
options, and wrapping it with an around callback, which makes the
failure app respect the set I18n locale by the controller at the time
the authentication failure is triggered, working as expected. (much more
like a normal controller would.)

I chose to introduce a callback in the failure app so we could wrap the
whole `respond` action processing rather than adding individual `locale`
options to the `I18n.t` calls, because that should ensure other possible
`I18n.t` calls from overridden failure apps would respect the set locale
as well, and makes it more like one would implement in a controller. I
don't recommend people using callbacks in their own failure apps though,
as this is not going to be documented as a "feature" of failures apps,
it's considered "internal" and could be refactored at any point.

It is possible to override the locale with the new `i18n_locale` method,
which simply defaults to the passed locale from the controller.

Closes #5247
Closes #5246

Related to: #3052, #4823, and possible others already closed.
Related to warden: (may be closed there afterwards)
https://github.com/wardencommunity/warden/issues/180
https://github.com/wardencommunity/warden/issues/170
2023-10-13 11:20:29 -03:00
Carlos Antonio da Silva
63939c121e Remove deprecated options argument from update methods
They were added to support an old/deprecated feature of Rails, as the
message was saying, we can now remove them from the code as well.
2023-10-13 11:02:45 -03:00
Carlos Antonio da Silva
49e4a991cf Remove some more code added to support older versions
Also change back to run CI on ubuntu-latest which should work with all
Ruby versions supported now.
2023-10-13 11:02:45 -03:00
Carlos Antonio da Silva
72b421e571 Update gemfile readme references 2023-10-13 10:44:06 -03:00
Carlos Antonio da Silva
23633b70f0 Bring back Ruby 2.7 support
It's EOL but the current versions of Rails are still supporting it, so
it makes sense for us to keep supporting it as well. And it doesn't give
us any extra maintenance burden as older versions have been doing.
2023-10-13 10:44:05 -03:00
Rafael Mendonça França
c8207373ea Drop support to all EOL rails versions 2023-10-12 16:52:01 -03:00
Rafael Mendonça França
c4701866ae Drop support to EOL Rubies
All Ruby 2.x are EOL now.
2023-10-12 16:49:10 -03:00
Carlos Antonio da Silva
e688b2f256 Merge branch '4-stable' 2023-10-11 19:12:53 -03:00
Carlos Antonio da Silva
1d6658097e Release v4.9.3 v4.9.3 2023-10-11 19:08:36 -03:00
Carlos Antonio da Silva
dcbfb32e66 Merge pull request #5640 from nmaggioni/nm_config_template_typo
Fix typo in config template
2023-10-11 11:41:16 -03:00
Carlos Antonio da Silva
9064ecbf15 Merge pull request #5640 from nmaggioni/nm_config_template_typo
Fix typo in config template
2023-10-11 11:40:50 -03:00
Niccolò Maggioni
4484eddc52 Fix caret placement typo 2023-10-11 16:35:35 +02:00
Carlos Antonio da Silva
c146b25f31 Better clarify need to override internal_methods
Co-authored-by: Eebs Kobeissi <ebrahim.kobeissi@gmail.com>
2023-10-10 19:51:06 -03:00
Carlos Antonio da Silva
9a08620378 Update changelog with Rails 7.1 mention [ci skip] 2023-10-10 19:51:04 -03:00
Carlos Antonio da Silva
407f223c65 Fix test warning about deprecated cache format in Rails 7.1 2023-10-10 11:39:30 -03:00
Carlos Antonio da Silva
f2a42abbf4 Ensure _prefixes is not available as an action method on controllers
There was a change introduced in Rails 7.1 that causes all public
actions of non-abstract controllers to become action methods, even if
they happen to match the name of an internal method defined by abstract
`ActionController::Base` and such, which is the case with `_prefixes`.

This change was intentional, it allows for example to have an action
called `status`, which is an internal method, and that is properly
managed as an action method now. However, it broke Devise due to
overriding `_prefixes`, which is a public method of Action Controller.

To fix, we are simply ensuring we keep `_prefixes` as an internal method
rather than action method, which matches previous behavior for this
particular method/implementation in Devise.

Ref: https://github.com/rails/rails/pull/48699
2023-10-10 11:29:29 -03:00
Carlos Antonio da Silva
218d14a227 Lock ubuntu version to 20.04 to workaround older Ruby build issues
Trying to get the build fully green for now.
2023-10-10 11:29:29 -03:00
Carlos Antonio da Silva
501ae58a25 Lock loofah on Rails <= 5.2
There's some incompatibility issue with loofah there since it uses an
older version of nokogiri, so I'm locking it on those older versions to
try to get a green build again there.
2023-10-10 11:29:29 -03:00
Carlos Antonio da Silva
373d83cc9d Use Bundler 1.x with Ruby <= 2.2
Here we go again.
2023-10-10 11:29:29 -03:00
Carlos Antonio da Silva
fb7faf7466 Fix code to support older versions of Ruby
We still support super old versions, yes, and it doesn't like `ensure`
without a `begin..end` unfortunately.

I plan to remove this support soon, but for now I don't want to stop
supporting it yet.
2023-10-10 11:29:29 -03:00
Carlos Antonio da Silva
9784555304 Merge pull request #5628 from soartec-lab/fix/dedicated_active_support_deprecation
Fixed missing migration to dedicated deprecator
2023-10-10 11:29:29 -03:00
Rafael Mendonça França
13cb6e269d Merge pull request #5599 from etiennebarrie/rails-edge-deprecations
Fix Rails main deprecations
2023-10-10 11:29:29 -03:00