Hello community, here is the log from the commit of package rubygem-devise for openSUSE:Factory checked in at 2020-10-05 19:30:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-devise (Old) and /work/SRC/openSUSE:Factory/.rubygem-devise.new.4249 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-devise" Mon Oct 5 19:30:44 2020 rev:8 rq:838028 version:4.7.3 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-devise/rubygem-devise.changes 2020-03-07 21:37:52.244257248 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-devise.new.4249/rubygem-devise.changes 2020-10-05 19:30:57.764654470 +0200 @@ -1,0 +2,7 @@ +Fri Sep 25 13:50:35 UTC 2020 - Stephan Kulow <[email protected]> + +updated to version 4.7.3 + see installed CHANGELOG.md + + +------------------------------------------------------------------- Old: ---- devise-4.7.1.gem New: ---- devise-4.7.3.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-devise.spec ++++++ --- /var/tmp/diff_new_pack.STdkuD/_old 2020-10-05 19:30:58.740658586 +0200 +++ /var/tmp/diff_new_pack.STdkuD/_new 2020-10-05 19:30:58.744658604 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-devise -Version: 4.7.1 +Version: 4.7.3 Release: 0 %define mod_name devise %define mod_full_name %{mod_name}-%{version} @@ -32,7 +32,7 @@ BuildRequires: %{ruby >= 2.1.0} BuildRequires: %{rubygem gem2rpm} BuildRequires: ruby-macros >= 5 -URL: https://github.com/plataformatec/devise +URL: https://github.com/heartcombo/devise Source: https://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml Summary: Flexible authentication solution for Rails with Warden ++++++ devise-4.7.1.gem -> devise-4.7.3.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md --- old/CHANGELOG.md 2019-09-06 19:02:57.000000000 +0200 +++ new/CHANGELOG.md 2020-09-21 02:19:56.000000000 +0200 @@ -1,4 +1,19 @@ -### Unreleased +### 4.7.3 - 2020-09-20 + +* bug fixes + * Do not modify `:except` option given to `#serializable_hash`. (by @dpep) + * Fix thor deprecation when running the devise generator. (by @deivid-rodriguez) + * Fix hanging tests for streaming controllers using Devise. (by @afn) + +### 4.7.2 - 2020-06-10 + +* enhancements + * Increase default stretches to 12 (by @sergey-alekseev) + * Ruby 2.7 support (kwarg warnings removed) + +* bug fixes + * Generate scoped views with proper scoped errors partial (by @shobhitic) + * Allow to set scoped `already_authenticated` error messages (by @gurgelrenan) ### 4.7.1 - 2019-09-06 @@ -21,7 +36,7 @@ ### 4.6.2 - 2019-03-26 * bug fixes - * Revert "Set `encrypted_password` to `nil` when `password` is set to `nil`" since it broke backward compatibility with existing applications. See more on https://github.com/plataformatec/devise/issues/5033#issuecomment-476386275 (by @mracos) + * Revert "Set `encrypted_password` to `nil` when `password` is set to `nil`" since it broke backward compatibility with existing applications. See more on https://github.com/heartcombo/devise/issues/5033#issuecomment-476386275 (by @mracos) ### 4.6.1 - 2019-02-11 @@ -68,7 +83,7 @@ * Add `autocomplete="new-password"` to new password fields (by @gssbzn) * Add `autocomplete="current-password"` to current password fields (by @gssbzn) * Remove redundant `self` from `database_authenticatable` module (by @abhishekkanojia) - * Update `simple_form` templates with changes from https://github.com/plataformatec/devise/commit/16b3d6d67c7e017d461ea17ed29ea9738dc77e83 and https://github.com/plataformatec/devise/commit/6260c29a867b9a656f1e1557abe347a523178fab (by @gssbzn) + * Update `simple_form` templates with changes from https://github.com/heartcombo/devise/commit/16b3d6d67c7e017d461ea17ed29ea9738dc77e83 and https://github.com/heartcombo/devise/commit/6260c29a867b9a656f1e1557abe347a523178fab (by @gssbzn) * Remove `:trackable` from the default modules in the generators, to be more GDPR-friendly (by @fakenine) * bug fixes @@ -315,5 +330,5 @@ You can check more examples and explanations on the [README section](README.md#strong-parameters) and on the [ParameterSanitizer docs](lib/devise/parameter_sanitizer.rb). -Please check [3-stable](https://github.com/plataformatec/devise/blob/3-stable/CHANGELOG.md) +Please check [3-stable](https://github.com/heartcombo/devise/blob/3-stable/CHANGELOG.md) for previous changes. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/MIT-LICENSE new/MIT-LICENSE --- old/MIT-LICENSE 2019-09-06 19:02:57.000000000 +0200 +++ new/MIT-LICENSE 2020-09-21 02:19:56.000000000 +0200 @@ -1,4 +1,5 @@ -Copyright 2009-2019 Plataformatec. http://plataformatec.com.br +Copyright 2020 Rafael França, Leonardo Tegon, Carlos Antônio da Silva. +Copyright 2009-2019 Plataformatec. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2019-09-06 19:02:57.000000000 +0200 +++ new/README.md 2020-09-21 02:19:56.000000000 +0200 @@ -1,11 +1,7 @@ - + -By [Plataformatec](http://plataformatec.com.br/). - -[](http://travis-ci.org/plataformatec/devise) -[](https://codeclimate.com/github/plataformatec/devise) - -This README is [also available in a friendly navigable format](http://devise.plataformatec.com.br/). +[](http://travis-ci.org/heartcombo/devise) +[](https://codeclimate.com/github/heartcombo/devise) Devise is a flexible authentication solution for Rails based on Warden. It: @@ -16,16 +12,16 @@ It's composed of 10 modules: -* [Database Authenticatable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/DatabaseAuthenticatable): hashes and stores a password in the database to validate the authenticity of a user while signing in. The authentication can be done both through POST requests or HTTP Basic Authentication. -* [Omniauthable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Omniauthable): adds OmniAuth (https://github.com/omniauth/omniauth) support. -* [Confirmable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Confirmable): sends emails with confirmation instructions and verifies whether an account is already confirmed during sign in. -* [Recoverable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Recoverable): resets the user password and sends reset instructions. -* [Registerable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Registerable): handles signing up users through a registration process, also allowing them to edit and destroy their account. -* [Rememberable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Rememberable): manages generating and clearing a token for remembering the user from a saved cookie. -* [Trackable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Trackable): tracks sign in count, timestamps and IP address. -* [Timeoutable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Timeoutable): expires sessions that have not been active in a specified period of time. -* [Validatable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Validatable): provides validations of email and password. It's optional and can be customized, so you're able to define your own validations. -* [Lockable](http://www.rubydoc.info/github/plataformatec/devise/master/Devise/Models/Lockable): locks an account after a specified number of failed sign-in attempts. Can unlock via email or after a specified time period. +* [Database Authenticatable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/DatabaseAuthenticatable): hashes and stores a password in the database to validate the authenticity of a user while signing in. The authentication can be done both through POST requests or HTTP Basic Authentication. +* [Omniauthable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Omniauthable): adds OmniAuth (https://github.com/omniauth/omniauth) support. +* [Confirmable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Confirmable): sends emails with confirmation instructions and verifies whether an account is already confirmed during sign in. +* [Recoverable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Recoverable): resets the user password and sends reset instructions. +* [Registerable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Registerable): handles signing up users through a registration process, also allowing them to edit and destroy their account. +* [Rememberable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Rememberable): manages generating and clearing a token for remembering the user from a saved cookie. +* [Trackable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Trackable): tracks sign in count, timestamps and IP address. +* [Timeoutable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Timeoutable): expires sessions that have not been active in a specified period of time. +* [Validatable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Validatable): provides validations of email and password. It's optional and can be customized, so you're able to define your own validations. +* [Lockable](http://www.rubydoc.info/github/heartcombo/devise/master/Devise/Models/Lockable): locks an account after a specified number of failed sign-in attempts. Can unlock via email or after a specified time period. ## Table of Contents @@ -58,7 +54,6 @@ - [Other ORMs](#other-orms) - [Rails API mode](#rails-api-mode) - [Additional information](#additional-information) - - [Heroku](#heroku) - [Warden](#warden) - [Contributors](#contributors) - [License](#license) @@ -73,15 +68,15 @@ The Devise Wiki has lots of additional information about Devise including many "how-to" articles and answers to the most frequently asked questions. Please browse the Wiki after finishing this README: -https://github.com/plataformatec/devise/wiki +https://github.com/heartcombo/devise/wiki ### Bug reports If you discover a problem with Devise, we would like to know about it. However, we ask that you please review these guidelines before submitting a bug report: -https://github.com/plataformatec/devise/wiki/Bug-reports +https://github.com/heartcombo/devise/wiki/Bug-reports -If you have discovered a security related bug, please do *NOT* use the GitHub issue tracker. Send an email to [email protected]. +If you have discovered a security related bug, please do *NOT* use the GitHub issue tracker. Send an email to [email protected]. ### StackOverflow and Mailing List @@ -97,7 +92,7 @@ You can view the Devise documentation in RDoc format here: -http://rubydoc.info/github/plataformatec/devise/master/frames +http://rubydoc.info/github/heartcombo/devise/master/frames If you need to use Devise with previous versions of Rails, you can always run "gem server" from the command line after you install the gem to access the old documentation. @@ -105,26 +100,26 @@ There are a few example applications available on GitHub that demonstrate various features of Devise with different versions of Rails. You can view them here: -https://github.com/plataformatec/devise/wiki/Example-Applications +https://github.com/heartcombo/devise/wiki/Example-Applications ### Extensions Our community has created a number of extensions that add functionality above and beyond what is included with Devise. You can view a list of available extensions and add your own here: -https://github.com/plataformatec/devise/wiki/Extensions +https://github.com/heartcombo/devise/wiki/Extensions ### Contributing We hope that you will consider contributing to Devise. Please read this short overview for some information about how to get started: -https://github.com/plataformatec/devise/wiki/Contributing +https://github.com/heartcombo/devise/wiki/Contributing You will usually want to write tests for your changes. To run the test suite, go into Devise's top-level directory and run `bundle install` and `bin/test`. Devise works with multiple Ruby and Rails versions, and ActiveRecord and Mongoid ORMs, which means you can run the test suite with some modifiers: `DEVISE_ORM` and `BUNDLE_GEMFILE`. ### DEVISE_ORM Since Devise support both Mongoid and ActiveRecord, we rely on this variable to run specific code for each ORM. -The default value of `DEVISE_ORM` is `active_record`. To run the tests for mongoid, you can pass `mongoid`: +The default value of `DEVISE_ORM` is `active_record`. To run the tests for Mongoid, you can pass `mongoid`: ``` DEVISE_ORM=mongoid bin/test @@ -136,7 +131,7 @@ ### BUNDLE_GEMFILE We can use this variable to tell bundler what Gemfile it should use (instead of the one in the current directory). -Inside the [gemfiles](https://github.com/plataformatec/devise/tree/master/gemfiles) directory, we have one for each version of Rails we support. When you send us a pull request, it may happen that the test suite breaks on Travis using some of them. If that's the case, you can simulate the same environment using the `BUNDLE_GEMFILE` variable. +Inside the [gemfiles](https://github.com/heartcombo/devise/tree/master/gemfiles) directory, we have one for each version of Rails we support. When you send us a pull request, it may happen that the test suite breaks on Travis using some of them. If that's the case, you can simulate the same environment using the `BUNDLE_GEMFILE` variable. For example, if the tests broke using Ruby 2.4.2 and Rails 4.1, you can do the following: ```bash rbenv shell 2.4.2 # or rvm use 2.4.2 @@ -170,10 +165,10 @@ ## Starting with Rails? -If you are building your first Rails application, we recommend you *do not* use Devise. Devise requires a good understanding of the Rails Framework. In such cases, we advise you to start a simple authentication system from scratch. Today, we have three resources that should help you get started: +If you are building your first Rails application, we recommend you *do not* use Devise. Devise requires a good understanding of the Rails Framework. In such cases, we advise you to start a simple authentication system from scratch. Here's a few resources that should help you get started: * Michael Hartl's online book: https://www.railstutorial.org/book/modeling_users -* Ryan Bates' Railscast: http://railscasts.com/episodes/250-authentication-from-scratch +* Ryan Bates' Railscasts: http://railscasts.com/episodes/250-authentication-from-scratch and http://railscasts.com/episodes/250-authentication-from-scratch-revised * Codecademy's Ruby on Rails: Authentication and Authorization: https://www.codecademy.com/learn/rails-auth Once you have solidified your understanding of Rails and authentication mechanisms, we assure you Devise will be very pleasant to work with. :smiley: @@ -270,16 +265,16 @@ The Devise method in your models also accepts some options to configure its modules. For example, you can choose the cost of the hashing algorithm with: ```ruby -devise :database_authenticatable, :registerable, :confirmable, :recoverable, stretches: 12 +devise :database_authenticatable, :registerable, :confirmable, :recoverable, stretches: 13 ``` Besides `:stretches`, you can define `:pepper`, `:encryptor`, `:confirm_within`, `:remember_for`, `:timeout_in`, `:unlock_in` among other options. For more details, see the initializer file that was created when you invoked the "devise:install" generator described above. This file is usually located at `/config/initializers/devise.rb`. ### Strong Parameters - +The Parameter Sanitizer API has changed for Devise 4 :warning: -*For previous Devise versions see https://github.com/plataformatec/devise/tree/3-stable#strong-parameters* +*For previous Devise versions see https://github.com/heartcombo/devise/tree/3-stable#strong-parameters* When you customize your own views, you may end up adding new attributes to forms. Rails 4 moved the parameter sanitization from the model to the controller, causing Devise to handle this concern at the controller as well. @@ -289,7 +284,7 @@ * `sign_up` (`Devise::RegistrationsController#create`) - Permits authentication keys plus `password` and `password_confirmation` * `account_update` (`Devise::RegistrationsController#update`) - Permits authentication keys plus `password`, `password_confirmation` and `current_password` -In case you want to permit additional parameters (the lazy way™), you can do so using a simple before filter in your `ApplicationController`: +In case you want to permit additional parameters (the lazy way™), you can do so using a simple before action in your `ApplicationController`: ```ruby class ApplicationController < ActionController::Base @@ -317,7 +312,7 @@ end ``` -Devise allows you to completely change Devise defaults or invoke custom behaviour by passing a block: +Devise allows you to completely change Devise defaults or invoke custom behavior by passing a block: To permit simple scalar values for username and email, use this @@ -440,7 +435,7 @@ end ``` - Or you can simply add new behaviour to it: + Or you can simply add new behavior to it: ```ruby class Users::SessionsController < Devise::SessionsController @@ -464,7 +459,7 @@ devise_for :users, path: 'auth', path_names: { sign_in: 'login', sign_out: 'logout', password: 'secret', confirmation: 'verification', unlock: 'unblock', registration: 'register', sign_up: 'cmon_let_me_in' } ``` -Be sure to check `devise_for` [documentation](http://www.rubydoc.info/github/plataformatec/devise/master/ActionDispatch/Routing/Mapper%3Adevise_for) for details. +Be sure to check `devise_for` [documentation](http://www.rubydoc.info/github/heartcombo/devise/master/ActionDispatch/Routing/Mapper%3Adevise_for) for details. If you have the need for more deep customization, for instance to also allow "/sign_in" besides "/users/sign_in", all you need to do is create your routes normally and wrap them in a `devise_scope` block in the router: @@ -520,7 +515,7 @@ Take a look at our locale file to check all available messages. You may also be interested in one of the many translations that are available on our wiki: -https://github.com/plataformatec/devise/wiki/I18n +https://github.com/heartcombo/devise/wiki/I18n Caution: Devise Controllers inherit from ApplicationController. If your app uses multiple locales, you should be sure to set I18n.locale in ApplicationController. @@ -532,15 +527,21 @@ ### Controller tests -Controller tests require that you include `Devise::Test::ControllerHelpers` on +Controller tests require that you include `Devise::Test::IntegrationHelpers` on your test case or its parent `ActionController::TestCase` superclass. -For Rails 5, include `Devise::Test::IntegrationHelpers` instead, since the superclass -for controller tests has been changed to ActionDispatch::IntegrationTest +For Rails versions prior to 5, include `Devise::Test::ControllerHelpers` instead, since the superclass +for controller tests was changed to ActionDispatch::IntegrationTest (for more details, see the [Integration tests](#integration-tests) section). ```ruby class PostsControllerTest < ActionController::TestCase - include Devise::Test::ControllerHelpers + include Devise::Test::IntegrationHelpers # Rails >= 5 +end +``` + +```ruby +class PostsControllerTest < ActionController::TestCase + include Devise::Test::ControllerHelpers # Rails < 5 end ``` @@ -620,7 +621,7 @@ You can read more about testing your Rails 3 - Rails 4 controllers with RSpec in the wiki: -* https://github.com/plataformatec/devise/wiki/How-To:-Test-controllers-with-Rails-(and-RSpec) +* https://github.com/heartcombo/devise/wiki/How-To:-Test-controllers-with-Rails-(and-RSpec) ### OmniAuth @@ -632,7 +633,7 @@ You can read more about OmniAuth support in the wiki: -* https://github.com/plataformatec/devise/wiki/OmniAuth:-Overview +* https://github.com/heartcombo/devise/wiki/OmniAuth:-Overview ### Configuring multiple models @@ -679,7 +680,7 @@ ### Password reset tokens and Rails logs -If you enable the [Recoverable](http://rubydoc.info/github/plataformatec/devise/master/Devise/Models/Recoverable) module, note that a stolen password reset token could give an attacker access to your application. Devise takes effort to generate random, secure tokens, and stores only token digests in the database, never plaintext. However the default logging behavior in Rails can cause plaintext tokens to leak into log files: +If you enable the [Recoverable](http://rubydoc.info/github/heartcombo/devise/master/Devise/Models/Recoverable) module, note that a stolen password reset token could give an attacker access to your application. Devise takes effort to generate random, secure tokens, and stores only token digests in the database, never plaintext. However the default logging behavior in Rails can cause plaintext tokens to leak into log files: 1. Action Mailer logs the entire contents of all outgoing emails to the DEBUG level. Password reset tokens delivered to users in email will be leaked. 2. Active Job logs all arguments to every enqueued job at the INFO level. If you configure Devise to use `deliver_later` to send password reset emails, password reset tokens will be leaked. @@ -697,41 +698,48 @@ ### Rails API Mode -Rails 5+ has a built-in [API Mode](https://edgeguides.rubyonrails.org/api_app.html) which optimizes Rails for use as an API (only). One of the side effects is that it changes the order of the middleware stack, and this can cause problems for `Devise::Test::IntegrationHelpers`. This problem usually surfaces as an ```undefined method `[]=' for nil:NilClass``` error when using integration test helpers, such as `#sign_in`. The solution is simply to reorder the middlewares by adding the following to test.rb: +Rails 5+ has a built-in [API Mode](https://edgeguides.rubyonrails.org/api_app.html) which optimizes Rails for use as an API (only). Devise is _somewhat_ able to handle applications that are built in this mode without additional modifications in the sense that it should not raise exceptions and the like. But some issues may still arise during `development`/`testing`, as we still don't know the full extent of this compatibility. (For more information, see [issue #4947](https://github.com/heartcombo/devise/issues/4947/)) -```ruby -Rails.application.config.middleware.insert_before Warden::Manager, ActionDispatch::Cookies -Rails.application.config.middleware.insert_before Warden::Manager, ActionDispatch::Session::CookieStore -``` +#### Supported Authentication Strategies +API-only applications don't support browser-based authentication via cookies, which is devise's default. Yet, devise can still provide authentication out of the box in those cases with the `http_authenticatable` strategy, which uses HTTP Basic Auth and authenticates the user on each request. (For more info, see this wiki article for [How To: Use HTTP Basic Authentication](https://github.com/heartcombo/devise/wiki/How-To:-Use-HTTP-Basic-Authentication)) -For a deeper understanding of this, review [this issue](https://github.com/plataformatec/devise/issues/4696). +The devise default for HTTP Auth is disabled, so it will need to be enabled in the devise initializer for the database strategy: -## Additional information +```ruby +config.http_authenticatable = [:database] +``` -### Heroku +This restriction does not limit you from implementing custom warden strategies, either in your application or via gem-based extensions for devise. +A common authentication strategy for APIs is token-based authentication. For more information on extending devise to support this type of authentication and others, see the wiki article for [Simple Token Authentication Examples and alternatives](https://github.com/heartcombo/devise/wiki/How-To:-Simple-Token-Authentication-Example#alternatives) or this blog post on [Custom authentication methods with Devise](http://blog.plataformatec.com.br/2019/01/custom-authentication-methods-with-devise/). -Using Devise on Heroku with Ruby on Rails 3.2 requires setting: +#### Testing +API Mode changes the order of the middleware stack, and this can cause problems for `Devise::Test::IntegrationHelpers`. This problem usually surfaces as an ```undefined method `[]=' for nil:NilClass``` error when using integration test helpers, such as `#sign_in`. The solution is simply to reorder the middlewares by adding the following to test.rb: ```ruby -config.assets.initialize_on_precompile = false +Rails.application.config.middleware.insert_before Warden::Manager, ActionDispatch::Cookies +Rails.application.config.middleware.insert_before Warden::Manager, ActionDispatch::Session::CookieStore ``` -Read more about the potential issues at http://guides.rubyonrails.org/asset_pipeline.html +For a deeper understanding of this, review [this issue](https://github.com/heartcombo/devise/issues/4696). + +Additionally be mindful that without views supported, some email-based flows from Confirmable, Recoverable and Lockable are not supported directly at this time. + +## Additional information ### Warden Devise is based on Warden, which is a general Rack authentication framework created by Daniel Neighman. We encourage you to read more about Warden here: -https://github.com/hassox/warden +https://github.com/wardencommunity/warden ### Contributors We have a long list of valued contributors. Check them all at: -https://github.com/plataformatec/devise/graphs/contributors +https://github.com/heartcombo/devise/graphs/contributors ## License -MIT License. Copyright 2009-2019 Plataformatec. http://plataformatec.com.br +MIT License. Copyright 2020 Rafael França, Leonardo Tegon, Carlos Antônio da Silva. Copyright 2009-2019 Plataformatec. -You are not granted rights or licenses to the trademarks of Plataformatec, including without limitation the Devise name or logo. +The Devise logo is licensed under [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](https://creativecommons.org/licenses/by-nc-nd/4.0/). diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/app/controllers/devise_controller.rb new/app/controllers/devise_controller.rb --- old/app/controllers/devise_controller.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/app/controllers/devise_controller.rb 2020-09-21 02:19:56.000000000 +0200 @@ -112,7 +112,7 @@ end if authenticated && resource = warden.user(resource_name) - flash[:alert] = I18n.t("devise.failure.already_authenticated") + set_flash_message(:alert, 'already_authenticated', scope: 'devise.failure') redirect_to after_sign_in_path_for(resource) end end @@ -184,7 +184,7 @@ options[:default] = Array(options[:default]).unshift(kind.to_sym) options[:resource_name] = resource_name options = devise_i18n_options(options) - I18n.t("#{options[:resource_name]}.#{kind}", options) + I18n.t("#{options[:resource_name]}.#{kind}", **options) end # Controllers inheriting DeviseController are advised to override this diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/app/helpers/devise_helper.rb new/app/helpers/devise_helper.rb --- old/app/helpers/devise_helper.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/app/helpers/devise_helper.rb 2020-09-21 02:19:56.000000000 +0200 @@ -1,14 +1,26 @@ # frozen_string_literal: true module DeviseHelper - # Retain this method for backwards compatibility, deprecated in favour of modifying the - # devise/shared/error_messages partial + # Retain this method for backwards compatibility, deprecated in favor of modifying the + # devise/shared/error_messages partial. def devise_error_messages! ActiveSupport::Deprecation.warn <<-DEPRECATION.strip_heredoc - [Devise] `DeviseHelper.devise_error_messages!` - is deprecated and it will be removed in the next major version. - To customize the errors styles please run `rails g devise:views` and modify the - `devise/shared/error_messages` partial. + [Devise] `DeviseHelper#devise_error_messages!` is deprecated and will be + removed in the next major version. + + Devise now uses a partial under "devise/shared/error_messages" to display + error messages by default, and make them easier to customize. Update your + views changing calls from: + + <%= devise_error_messages! %> + + to: + + <%= render "devise/shared/error_messages", resource: resource %> + + To start customizing how errors are displayed, you can copy the partial + from devise to your `app/views` folder. Alternatively, you can run + `rails g devise:views` which will copy all of them again to your app. DEPRECATION return "" if resource.errors.empty? diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/app/mailers/devise/mailer.rb new/app/mailers/devise/mailer.rb --- old/app/mailers/devise/mailer.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/app/mailers/devise/mailer.rb 2020-09-21 02:19:56.000000000 +0200 @@ -4,26 +4,26 @@ class Devise::Mailer < Devise.parent_mailer.constantize include Devise::Mailers::Helpers - def confirmation_instructions(record, token, opts={}) + def confirmation_instructions(record, token, opts = {}) @token = token devise_mail(record, :confirmation_instructions, opts) end - def reset_password_instructions(record, token, opts={}) + def reset_password_instructions(record, token, opts = {}) @token = token devise_mail(record, :reset_password_instructions, opts) end - def unlock_instructions(record, token, opts={}) + def unlock_instructions(record, token, opts = {}) @token = token devise_mail(record, :unlock_instructions, opts) end - def email_changed(record, opts={}) + def email_changed(record, opts = {}) devise_mail(record, :email_changed, opts) end - def password_change(record, opts={}) + def password_change(record, opts = {}) devise_mail(record, :password_change, opts) end end Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/config/locales/en.yml new/config/locales/en.yml --- old/config/locales/en.yml 2019-09-06 19:02:57.000000000 +0200 +++ new/config/locales/en.yml 2020-09-21 02:19:56.000000000 +0200 @@ -1,4 +1,4 @@ -# Additional translations at https://github.com/plataformatec/devise/wiki/I18n +# Additional translations at https://github.com/heartcombo/devise/wiki/I18n en: devise: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/controllers/helpers.rb new/lib/devise/controllers/helpers.rb --- old/lib/devise/controllers/helpers.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/controllers/helpers.rb 2020-09-21 02:19:56.000000000 +0200 @@ -36,14 +36,14 @@ # before_action ->{ authenticate_blogger! :admin } # Redirects to the admin login page # current_blogger :user # Preferably returns a User if one is signed in # - def devise_group(group_name, opts={}) + def devise_group(group_name, opts = {}) mappings = "[#{ opts[:contains].map { |m| ":#{m}" }.join(',') }]" class_eval <<-METHODS, __FILE__, __LINE__ + 1 - def authenticate_#{group_name}!(favourite=nil, opts={}) + def authenticate_#{group_name}!(favorite = nil, opts = {}) unless #{group_name}_signed_in? mappings = #{mappings} - mappings.unshift mappings.delete(favourite.to_sym) if favourite + mappings.unshift mappings.delete(favorite.to_sym) if favorite mappings.each do |mapping| opts[:scope] = mapping warden.authenticate!(opts) if !devise_controller? || opts.delete(:force) @@ -57,9 +57,9 @@ end end - def current_#{group_name}(favourite=nil) + def current_#{group_name}(favorite = nil) mappings = #{mappings} - mappings.unshift mappings.delete(favourite.to_sym) if favourite + mappings.unshift mappings.delete(favorite.to_sym) if favorite mappings.each do |mapping| current = warden.authenticate(scope: mapping) return current if current @@ -113,7 +113,7 @@ mapping = mapping.name class_eval <<-METHODS, __FILE__, __LINE__ + 1 - def authenticate_#{mapping}!(opts={}) + def authenticate_#{mapping}!(opts = {}) opts[:scope] = :#{mapping} warden.authenticate!(opts) if !devise_controller? || opts.delete(:force) end @@ -252,7 +252,7 @@ # Overwrite Rails' handle unverified request to sign out all scopes, # clear run strategies and remove cached variables. def handle_unverified_request - super # call the default behaviour which resets/nullifies/raises + super # call the default behavior which resets/nullifies/raises request.env["devise.skip_storage"] = true sign_out_all_scopes(false) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/controllers/sign_in_out.rb new/lib/devise/controllers/sign_in_out.rb --- old/lib/devise/controllers/sign_in_out.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/controllers/sign_in_out.rb 2020-09-21 02:19:56.000000000 +0200 @@ -10,7 +10,7 @@ # cause exceptions to be thrown from this method; if you simply want to check # if a scope has already previously been authenticated without running # authentication hooks, you can directly call `warden.authenticated?(scope: scope)` - def signed_in?(scope=nil) + def signed_in?(scope = nil) [scope || Devise.mappings.keys].flatten.any? do |_scope| warden.authenticate?(scope: _scope) end @@ -21,7 +21,7 @@ # to the set_user method in warden. # If you are using a custom warden strategy and the timeoutable module, you have to # set `env["devise.skip_timeout"] = true` in the request to use this method, like we do - # in the sessions controller: https://github.com/plataformatec/devise/blob/master/app/controllers/devise/sessions_controller.rb#L7 + # in the sessions controller: https://github.com/heartcombo/devise/blob/master/app/controllers/devise/sessions_controller.rb#L7 # # Examples: # @@ -77,7 +77,7 @@ # sign_out :user # sign_out(scope) # sign_out @user # sign_out(resource) # - def sign_out(resource_or_scope=nil) + def sign_out(resource_or_scope = nil) return sign_out_all_scopes unless resource_or_scope scope = Devise::Mapping.find_scope!(resource_or_scope) user = warden.user(scope: scope, run_callbacks: false) # If there is no user @@ -92,7 +92,7 @@ # Sign out all active users or scopes. This helper is useful for signing out all roles # in one click. This signs out ALL scopes in warden. Returns true if there was at least one logout # and false if there was no user logged in on all scopes. - def sign_out_all_scopes(lock=true) + def sign_out_all_scopes(lock = true) users = Devise.mappings.keys.map { |s| warden.user(scope: s, run_callbacks: false) } warden.logout diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/controllers/url_helpers.rb new/lib/devise/controllers/url_helpers.rb --- old/lib/devise/controllers/url_helpers.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/controllers/url_helpers.rb 2020-09-21 02:19:56.000000000 +0200 @@ -34,7 +34,7 @@ end end - def self.generate_helpers!(routes=nil) + def self.generate_helpers!(routes = nil) routes ||= begin mappings = Devise.mappings.values.map(&:used_helpers).flatten.uniq Devise::URL_HELPERS.slice(*mappings) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/failure_app.rb new/lib/devise/failure_app.rb --- old/lib/devise/failure_app.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/failure_app.rb 2020-09-21 02:19:56.000000000 +0200 @@ -71,7 +71,6 @@ end flash.now[:alert] = i18n_message(:invalid) if is_flashing_format? - # self.response = recall_app(warden_options[:recall]).call(env) self.response = recall_app(warden_options[:recall]).call(request.env) end @@ -107,7 +106,7 @@ options[:authentication_keys] = keys.join(I18n.translate(:"support.array.words_connector")) options = i18n_options(options) - I18n.t(:"#{scope}.#{message}", options) + I18n.t(:"#{scope}.#{message}", **options) else message.to_s end @@ -152,7 +151,7 @@ # We need to add the rootpath to `script_name` manually for applications that use a Rails # version lower than 5.1. Otherwise, it is going to generate a wrong path for Engines - # that use Devise. Remove it when the support of Rails 5.0 is droped. + # that use Devise. Remove it when the support of Rails 5.0 is dropped. elsif root_path_defined?(context) && !rails_51_and_up? rootpath = context.routes.url_helpers.root_path opts[:script_name] = rootpath.chomp('/') if rootpath.length > 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/hooks/timeoutable.rb new/lib/devise/hooks/timeoutable.rb --- old/lib/devise/hooks/timeoutable.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/hooks/timeoutable.rb 2020-09-21 02:19:56.000000000 +0200 @@ -21,8 +21,8 @@ proxy = Devise::Hooks::Proxy.new(warden) - if record.timedout?(last_request_at) && - !env['devise.skip_timeout'] && + if !env['devise.skip_timeout'] && + record.timedout?(last_request_at) && !proxy.remember_me_is_active?(record) Devise.sign_out_all_scopes ? proxy.sign_out : proxy.sign_out(scope) throw :warden, scope: scope, message: :timeout diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/mapping.rb new/lib/devise/mapping.rb --- old/lib/devise/mapping.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/mapping.rb 2020-09-21 02:19:56.000000000 +0200 @@ -46,7 +46,7 @@ raise "Could not find a valid mapping for #{obj.inspect}" end - def self.find_by_path!(path, path_type=:fullpath) + def self.find_by_path!(path, path_type = :fullpath) Devise.mappings.each_value { |m| return m if path.include?(m.send(path_type)) } raise "Could not find a valid mapping for path #{path.inspect}" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/models/authenticatable.rb new/lib/devise/models/authenticatable.rb --- old/lib/devise/models/authenticatable.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/models/authenticatable.rb 2020-09-21 02:19:56.000000000 +0200 @@ -104,7 +104,7 @@ # given to :except will simply add names to exempt to Devise internal list. def serializable_hash(options = nil) options = options.try(:dup) || {} - options[:except] = Array(options[:except]) + options[:except] = Array(options[:except]).dup if options[:force_except] options[:except].concat Array(options[:force_except]) @@ -152,7 +152,8 @@ # # If the record is new or changed then delay the # # delivery until the after_commit callback otherwise # # send now because after_commit will not be called. - # if new_record? || changed? + # # For Rails < 6 use `changed?` instead of `saved_changes?`. + # if new_record? || saved_changes? # pending_devise_notifications << [notification, args] # else # render_and_send_devise_message(notification, *args) @@ -271,17 +272,17 @@ find_first_by_auth_conditions(tainted_conditions) end - def find_first_by_auth_conditions(tainted_conditions, opts={}) + def find_first_by_auth_conditions(tainted_conditions, opts = {}) to_adapter.find_first(devise_parameter_filter.filter(tainted_conditions).merge(opts)) end # Find or initialize a record setting an error if it can't be found. - def find_or_initialize_with_error_by(attribute, value, error=:invalid) #:nodoc: + def find_or_initialize_with_error_by(attribute, value, error = :invalid) #:nodoc: find_or_initialize_with_errors([attribute], { attribute => value }, error) end # Find or initialize a record with group of attributes based on a list of required attributes. - def find_or_initialize_with_errors(required_attributes, attributes, error=:invalid) #:nodoc: + def find_or_initialize_with_errors(required_attributes, attributes, error = :invalid) #:nodoc: attributes.try(:permit!) attributes = attributes.to_h.with_indifferent_access .slice(*required_attributes) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/models/confirmable.rb new/lib/devise/models/confirmable.rb --- old/lib/devise/models/confirmable.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/models/confirmable.rb 2020-09-21 02:19:56.000000000 +0200 @@ -76,7 +76,7 @@ # Confirm a user by setting it's confirmed_at to actual time. If the user # is already confirmed, add an error to email field. If the user is invalid # add errors - def confirm(args={}) + def confirm(args = {}) pending_any_confirmation do if confirmation_period_expired? self.errors.add(:email, :confirmation_period_expired, @@ -334,7 +334,7 @@ # confirmation instructions to it. If not, try searching for a user by unconfirmed_email # field. If no user is found, returns a new user with an email not found error. # Options must contain the user email - def send_confirmation_instructions(attributes={}) + def send_confirmation_instructions(attributes = {}) confirmable = find_by_unconfirmed_email_with_errors(attributes) if reconfirmable unless confirmable.try(:persisted?) confirmable = find_or_initialize_with_errors(confirmation_keys, attributes, :not_found) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/models/database_authenticatable.rb new/lib/devise/models/database_authenticatable.rb --- old/lib/devise/models/database_authenticatable.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/models/database_authenticatable.rb 2020-09-21 02:19:56.000000000 +0200 @@ -7,6 +7,10 @@ # Authenticatable Module, responsible for hashing the password and # validating the authenticity of a user while signing in. # + # This module defines a `password=` method. This method will hash the argument + # and store it in the `encrypted_password` column, bypassing any pre-existing + # `password` column if it exists. + # # == Options # # DatabaseAuthenticatable adds the following options to devise_for: @@ -195,7 +199,7 @@ # Hashes the password using bcrypt. Custom hash functions should override # this method to apply their own algorithm. # - # See https://github.com/plataformatec/devise-encryptable for examples + # See https://github.com/heartcombo/devise-encryptable for examples # of other hashing engines. def password_digest(password) Devise::Encryptor.digest(self.class, password) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/models/lockable.rb new/lib/devise/models/lockable.rb --- old/lib/devise/models/lockable.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/models/lockable.rb 2020-09-21 02:19:56.000000000 +0200 @@ -168,7 +168,7 @@ # unlock instructions to it. If not user is found, returns a new user # with an email not found error. # Options must contain the user's unlock keys - def send_unlock_instructions(attributes={}) + def send_unlock_instructions(attributes = {}) lockable = find_or_initialize_with_errors(unlock_keys, attributes, :not_found) lockable.resend_unlock_instructions if lockable.persisted? lockable diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/models/recoverable.rb new/lib/devise/models/recoverable.rb --- old/lib/devise/models/recoverable.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/models/recoverable.rb 2020-09-21 02:19:56.000000000 +0200 @@ -131,7 +131,7 @@ # password instructions to it. If user is not found, returns a new user # with an email not found error. # Attributes must contain the user's email - def send_reset_password_instructions(attributes={}) + def send_reset_password_instructions(attributes = {}) recoverable = find_or_initialize_with_errors(reset_password_keys, attributes, :not_found) recoverable.send_reset_password_instructions if recoverable.persisted? recoverable @@ -142,7 +142,7 @@ # try saving the record. If not user is found, returns a new user # containing an error in reset_password_token attribute. # Attributes must contain reset_password_token, password and confirmation - def reset_password_by_token(attributes={}) + def reset_password_by_token(attributes = {}) original_token = attributes[:reset_password_token] reset_password_token = Devise.token_generator.digest(self, :reset_password_token, original_token) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/models/rememberable.rb new/lib/devise/models/rememberable.rb --- old/lib/devise/models/rememberable.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/models/rememberable.rb 2020-09-21 02:19:56.000000000 +0200 @@ -102,7 +102,7 @@ def remember_me?(token, generated_at) # TODO: Normalize the JSON type coercion along with the Timeoutable hook - # in a single place https://github.com/plataformatec/devise/blob/ffe9d6d406e79108cf32a2c6a1d0b3828849c40b/lib/devise/hooks/timeoutable.rb#L14-L18 + # in a single place https://github.com/heartcombo/devise/blob/ffe9d6d406e79108cf32a2c6a1d0b3828849c40b/lib/devise/hooks/timeoutable.rb#L14-L18 if generated_at.is_a?(String) generated_at = time_from_json(generated_at) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/models/trackable.rb new/lib/devise/models/trackable.rb --- old/lib/devise/models/trackable.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/models/trackable.rb 2020-09-21 02:19:56.000000000 +0200 @@ -33,7 +33,7 @@ def update_tracked_fields!(request) # We have to check if the user is already persisted before running # `save` here because invalid users can be saved if we don't. - # See https://github.com/plataformatec/devise/issues/4673 for more details. + # See https://github.com/heartcombo/devise/issues/4673 for more details. return if new_record? update_tracked_fields(request) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/rails/routes.rb new/lib/devise/rails/routes.rb --- old/lib/devise/rails/routes.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/rails/routes.rb 2020-09-21 02:19:56.000000000 +0200 @@ -287,7 +287,7 @@ # root to: "admin/dashboard#show", as: :user_root # end # - def authenticate(scope=nil, block=nil) + def authenticate(scope = nil, block = nil) constraints_for(:authenticate!, scope, block) do yield end @@ -311,7 +311,7 @@ # # root to: 'landing#show' # - def authenticated(scope=nil, block=nil) + def authenticated(scope = nil, block = nil) constraints_for(:authenticate?, scope, block) do yield end @@ -328,7 +328,7 @@ # # root to: 'dashboard#show' # - def unauthenticated(scope=nil) + def unauthenticated(scope = nil) constraint = lambda do |request| not request.env["warden"].authenticate? scope: scope end @@ -474,7 +474,7 @@ @scope = current_scope end - def constraints_for(method_to_apply, scope=nil, block=nil) + def constraints_for(method_to_apply, scope = nil, block = nil) constraint = lambda do |request| request.env['warden'].send(method_to_apply, scope: scope) && (block.nil? || block.call(request.env["warden"].user(scope))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/test/controller_helpers.rb new/lib/devise/test/controller_helpers.rb --- old/lib/devise/test/controller_helpers.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/test/controller_helpers.rb 2020-09-21 02:19:56.000000000 +0200 @@ -37,6 +37,8 @@ @response end + ruby2_keywords(:process) if respond_to?(:ruby2_keywords, true) + # We need to set up the environment variables and the response in the controller. def setup_controller_for_warden #:nodoc: @request.env['action_controller.instance'] = @controller @@ -141,7 +143,7 @@ @controller.response.headers.merge!(headers) @controller.response.content_type = headers["Content-Type"] unless Rails::VERSION::MAJOR >= 5 @controller.status = status - @controller.response.body = response.body + @controller.response_body = response.body nil # causes process return @response end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/test/integration_helpers.rb new/lib/devise/test/integration_helpers.rb --- old/lib/devise/test/integration_helpers.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/test/integration_helpers.rb 2020-09-21 02:19:56.000000000 +0200 @@ -28,7 +28,7 @@ end end - # Signs in a specific resource, mimicking a successfull sign in + # Signs in a specific resource, mimicking a successful sign in # operation through +Devise::SessionsController#create+. # # * +resource+ - The resource that should be authenticated diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise/version.rb new/lib/devise/version.rb --- old/lib/devise/version.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise/version.rb 2020-09-21 02:19:56.000000000 +0200 @@ -1,5 +1,5 @@ # frozen_string_literal: true module Devise - VERSION = "4.7.1".freeze + VERSION = "4.7.3".freeze end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/devise.rb new/lib/devise.rb --- old/lib/devise.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/devise.rb 2020-09-21 02:19:56.000000000 +0200 @@ -71,7 +71,7 @@ # The number of times to hash the password. mattr_accessor :stretches - @@stretches = 11 + @@stretches = 12 # The default key used when authenticating over http auth. mattr_accessor :http_authentication_key @@ -297,10 +297,6 @@ mattr_accessor :sign_in_after_change_password @@sign_in_after_change_password = true - def self.rails51? # :nodoc: - Rails.gem_version >= Gem::Version.new("5.1.x") - end - def self.activerecord51? # :nodoc: defined?(ActiveRecord) && ActiveRecord.gem_version >= Gem::Version.new("5.1.x") end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/generators/devise/devise_generator.rb new/lib/generators/devise/devise_generator.rb --- old/lib/generators/devise/devise_generator.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/generators/devise/devise_generator.rb 2020-09-21 02:19:56.000000000 +0200 @@ -13,7 +13,7 @@ desc "Generates a model with the given NAME (if one does not exist) with devise " \ "configuration plus a migration file and devise routes." - hook_for :orm + hook_for :orm, required: true class_option :routes, desc: "Generate routes", type: :boolean, default: true diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/generators/devise/install_generator.rb new/lib/generators/devise/install_generator.rb --- old/lib/generators/devise/install_generator.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/generators/devise/install_generator.rb 2020-09-21 02:19:56.000000000 +0200 @@ -11,7 +11,7 @@ source_root File.expand_path("../../templates", __FILE__) desc "Creates a Devise initializer and copy locale files to your application." - class_option :orm + class_option :orm, required: true def copy_initializer unless options[:orm] @@ -37,10 +37,6 @@ def show_readme readme "README" if behavior == :invoke end - - def rails_4? - Rails::VERSION::MAJOR == 4 - end end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/generators/devise/views_generator.rb new/lib/generators/devise/views_generator.rb --- old/lib/generators/devise/views_generator.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/generators/devise/views_generator.rb 2020-09-21 02:19:56.000000000 +0200 @@ -42,7 +42,7 @@ def view_directory(name, _target_path = nil) directory name.to_s, _target_path || "#{target_path}/#{name}" do |content| if scope - content.gsub "devise/shared/links", "#{plural_scope}/shared/links" + content.gsub("devise/shared", "#{plural_scope}/shared") else content end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/generators/templates/README new/lib/generators/templates/README --- old/lib/generators/templates/README 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/generators/templates/README 2020-09-21 02:19:56.000000000 +0200 @@ -1,6 +1,6 @@ =============================================================================== -Some setup you must do manually if you haven't yet: +Depending on your application's configuration some manual setup may be required: 1. Ensure you have defined default url options in your environments files. Here is an example of default_url_options appropriate for a development environment @@ -10,10 +10,14 @@ In production, :host should be set to the actual host of your application. + * Required for all applications. * + 2. Ensure you have defined root_url to *something* in your config/routes.rb. For example: root to: "home#index" + + * Not required for API-only Applications * 3. Ensure you have flash messages in app/views/layouts/application.html.erb. For example: @@ -21,8 +25,12 @@ <p class="notice"><%= notice %></p> <p class="alert"><%= alert %></p> + * Not required for API-only Applications * + 4. You can copy Devise views (for customization) to your app by running: rails g devise:views + + * Not required * =============================================================================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/generators/templates/controllers/omniauth_callbacks_controller.rb new/lib/generators/templates/controllers/omniauth_callbacks_controller.rb --- old/lib/generators/templates/controllers/omniauth_callbacks_controller.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/generators/templates/controllers/omniauth_callbacks_controller.rb 2020-09-21 02:19:56.000000000 +0200 @@ -9,7 +9,7 @@ # end # More info at: - # https://github.com/plataformatec/devise#omniauth + # https://github.com/heartcombo/devise#omniauth # GET|POST /resource/auth/twitter # def passthru diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/generators/templates/devise.rb new/lib/generators/templates/devise.rb --- old/lib/generators/templates/devise.rb 2019-09-06 19:02:57.000000000 +0200 +++ new/lib/generators/templates/devise.rb 2020-09-21 02:19:56.000000000 +0200 @@ -1,5 +1,11 @@ # frozen_string_literal: true +# Assuming you have not yet modified this file, each configuration option below +# is set to its default value. Note that some are commented out while others +# are not: uncommented lines are intended to protect your configuration from +# breaking changes in upgrades (i.e., in the event that future versions of +# Devise change the default values for those options). +# # Use this hook to configure devise mailer, warden hooks and so forth. # Many of these configuration options can be set straight in your model. Devise.setup do |config| @@ -68,7 +74,10 @@ # Tell if authentication through HTTP Auth is enabled. False by default. # It can be set to an array that will enable http authentication only for the # given strategies, for example, `config.http_authenticatable = [:database]` will - # enable it only for database authentication. The supported strategies are: + # enable it only for database authentication. + # For API-only applications to support authentication "out-of-the-box", you will likely want to + # enable this with :database unless you are using a custom strategy. + # The supported strategies are: # :database = Support basic authentication with authentication key + password # config.http_authenticatable = false @@ -103,15 +112,18 @@ # config.reload_routes = true # ==> Configuration for :database_authenticatable - # For bcrypt, this is the cost for hashing the password and defaults to 11. If + # For bcrypt, this is the cost for hashing the password and defaults to 12. If # using other algorithms, it sets how many times you want the password to be hashed. + # The number of stretches used for generating the hashed password are stored + # with the hashed password. This allows you to change the stretches without + # invalidating existing passwords. # # Limiting the stretches to just one in testing will increase the performance of # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use # a value less than 10 in other environments. Note that, for bcrypt (the default # algorithm), the cost increases exponentially with the number of stretches (e.g. # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation). - config.stretches = Rails.env.test? ? 1 : 11 + config.stretches = Rails.env.test? ? 1 : 12 # Set up a pepper to generate the hashed password. # config.pepper = '<%= SecureRandom.hex(64) %>' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2019-09-06 19:02:57.000000000 +0200 +++ new/metadata 2020-09-21 02:19:56.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: devise version: !ruby/object:Gem::Version - version: 4.7.1 + version: 4.7.3 platform: ruby authors: - José Valim @@ -9,7 +9,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2019-09-06 00:00:00.000000000 Z +date: 2020-09-21 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: warden @@ -82,7 +82,7 @@ - !ruby/object:Gem::Version version: '0' description: Flexible authentication solution for Rails with Warden -email: [email protected] +email: [email protected] executables: [] extensions: [] extra_rdoc_files: [] @@ -198,7 +198,7 @@ - lib/generators/templates/simple_form_for/registrations/new.html.erb - lib/generators/templates/simple_form_for/sessions/new.html.erb - lib/generators/templates/simple_form_for/unlocks/new.html.erb -homepage: https://github.com/plataformatec/devise +homepage: https://github.com/heartcombo/devise licenses: - MIT metadata: {} @@ -217,7 +217,7 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubygems_version: 3.0.6 +rubygems_version: 3.0.3 signing_key: specification_version: 4 summary: Flexible authentication solution for Rails with Warden
