devise 4.9.3 → 4.9.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1dc134957d3855a45dd68b04b36bca2a993b095b1c05f5d87f4a68d2469660df
4
- data.tar.gz: '09de3502b6e5afdb42d9c34b7896dfd9fcc0d58fa088951a2aab2f39095246c4'
3
+ metadata.gz: 5ee56c70aa194195a4ce7ee729124c9701fa62a1ca71a0b74fa1d45f7b452c8e
4
+ data.tar.gz: f6d6fbd0a844de35d7a27ebb52eadc8da5440436cd8b037e917be40e8379b670
5
5
  SHA512:
6
- metadata.gz: 2413954e6decdda1c1e0adf5bf39b8ede790ef90dfc61d433528e28948f248a598ac1772b2606ff1b79f07ae330aec153e92b53aa0b2708a1b7ca19156034e81
7
- data.tar.gz: a04f21e33fb88287ff808102c76e550a70165b2fddbde92c3984a4fa3c325fe507b68366c4b1a11d847ddce3e3722e4bda7d09642f140a872c7c0c73de32ba50
6
+ metadata.gz: d29b37afe41e4751cdbdc259c3cb7f0926bfde20949054e652677175dec119bfa49054b829103ce382ddb9655f2a51ba9f75576a2ce112bf9e179cf6f617e228
7
+ data.tar.gz: 5bd002f04b9296993f48af6e312fe94a5a0ea80cacaf3226ba78317a3a100fcdd3060c70b6592398fb8206dd98a12aa6ed906ffb29ed589b144fb1f59c923fc9
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### 4.9.4 - 2024-04-10
2
+
3
+ * enhancements
4
+ * Add support for Ruby 3.3. (no changes needed)
5
+
6
+ * bug fixes
7
+ * Respect locale set by controller in failure app. Devise will carry over the current I18n.locale option when triggering authentication, and will wrap the failure app call with it. [#5567](https://github.com/heartcombo/devise/pull/5567)
8
+
1
9
  ### 4.9.3 - 2023-10-11
2
10
 
3
11
  * enhancements
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2020-2023 Rafael França, Leonardo Tegon, Carlos Antônio da Silva.
1
+ Copyright 2020-2024 Rafael França, Leonardo Tegon, Carlos Antônio da Silva.
2
2
  Copyright 2009-2019 Plataformatec.
3
3
 
4
4
  Permission is hereby granted, free of charge, to any person obtaining
data/README.md CHANGED
@@ -46,7 +46,7 @@ It's composed of 10 modules:
46
46
  - [Integration tests](#integration-tests)
47
47
  - [OmniAuth](#omniauth)
48
48
  - [Configuring multiple models](#configuring-multiple-models)
49
- - [ActiveJob Integration](#activejob-integration)
49
+ - [Active Job Integration](#active-job-integration)
50
50
  - [Password reset tokens and Rails logs](#password-reset-tokens-and-rails-logs)
51
51
  - [Other ORMs](#other-orms)
52
52
  - [Rails API mode](#rails-api-mode)
@@ -767,6 +767,6 @@ https://github.com/heartcombo/devise/graphs/contributors
767
767
 
768
768
  ## License
769
769
 
770
- MIT License. Copyright 2020-2023 Rafael França, Leonardo Tegon, Carlos Antônio da Silva. Copyright 2009-2019 Plataformatec.
770
+ MIT License. Copyright 2020-2024 Rafael França, Leonardo Tegon, Carlos Antônio da Silva. Copyright 2009-2019 Plataformatec.
771
771
 
772
772
  The Devise logo is licensed under [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](https://creativecommons.org/licenses/by-nc-nd/4.0/).
@@ -45,7 +45,7 @@ class Devise::SessionsController < DeviseController
45
45
  end
46
46
 
47
47
  def auth_options
48
- { scope: resource_name, recall: "#{controller_path}#new" }
48
+ { scope: resource_name, recall: "#{controller_path}#new", locale: I18n.locale }
49
49
  end
50
50
 
51
51
  def translation_scope
@@ -46,6 +46,7 @@ module Devise
46
46
  mappings.unshift mappings.delete(favorite.to_sym) if favorite
47
47
  mappings.each do |mapping|
48
48
  opts[:scope] = mapping
49
+ opts[:locale] = I18n.locale
49
50
  warden.authenticate!(opts) if !devise_controller? || opts.delete(:force)
50
51
  end
51
52
  end
@@ -115,6 +116,7 @@ module Devise
115
116
  class_eval <<-METHODS, __FILE__, __LINE__ + 1
116
117
  def authenticate_#{mapping}!(opts = {})
117
118
  opts[:scope] = :#{mapping}
119
+ opts[:locale] = I18n.locale
118
120
  warden.authenticate!(opts) if !devise_controller? || opts.delete(:force)
119
121
  end
120
122
 
@@ -18,6 +18,11 @@ module Devise
18
18
 
19
19
  delegate :flash, to: :request
20
20
 
21
+ include AbstractController::Callbacks
22
+ around_action do |failure_app, action|
23
+ I18n.with_locale(failure_app.i18n_locale, &action)
24
+ end
25
+
21
26
  def self.call(env)
22
27
  @respond ||= action(:respond)
23
28
  @respond.call(env)
@@ -107,7 +112,7 @@ module Devise
107
112
  options[:default] = [message]
108
113
  auth_keys = scope_class.authentication_keys
109
114
  keys = (auth_keys.respond_to?(:keys) ? auth_keys.keys : auth_keys).map { |key| scope_class.human_attribute_name(key) }
110
- options[:authentication_keys] = keys.join(I18n.translate(:"support.array.words_connector"))
115
+ options[:authentication_keys] = keys.join(I18n.t(:"support.array.words_connector"))
111
116
  options = i18n_options(options)
112
117
 
113
118
  I18n.t(:"#{scope}.#{message}", **options)
@@ -116,6 +121,10 @@ module Devise
116
121
  end
117
122
  end
118
123
 
124
+ def i18n_locale
125
+ warden_options[:locale]
126
+ end
127
+
119
128
  def redirect_url
120
129
  if warden_message == :timeout
121
130
  flash[:timedout] = true if is_flashing_format?
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Devise
4
- VERSION = "4.9.3".freeze
4
+ VERSION = "4.9.4".freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.9.3
4
+ version: 4.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - José Valim
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-10-11 00:00:00.000000000 Z
12
+ date: 2024-04-10 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: warden
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  - !ruby/object:Gem::Version
230
230
  version: '0'
231
231
  requirements: []
232
- rubygems_version: 3.4.10
232
+ rubygems_version: 3.5.3
233
233
  signing_key:
234
234
  specification_version: 4
235
235
  summary: Flexible authentication solution for Rails with Warden