Compare commits

...

3530 Commits

Author SHA1 Message Date
Carlos Antonio da Silva
731074bf09 Stop updating copyright every year [ci skip] 2026-01-05 10:02:56 -03:00
Carlos Antonio da Silva
35920d27e5 Exclude Rails main + Ruby 3.2
It dropped support to Ruby 3.2 which is expected to be EOL by
2026-03-31.
2026-01-05 09:55:48 -03:00
Carlos Antonio da Silva
00a97782cb Release v5.0.0.rc
Given a lot of time has passed since the last v4.x release, and there's
been many changes (including breaking ones) merged to main, let's go
with an "RC" version before doing a final release.

If we don't hear any major issues, I plan to release a final version in
a couple of weeks.
2025-12-31 15:46:05 -03:00
Carlos Antonio da Silva
119a40f9d3 Fix gemspec and readme, Devise v5 will support Rails >= 7, not 6
As per our test matrix.
2025-12-31 15:35:31 -03:00
Carlos Antonio da Silva
1096b60967 Remove deprecated Devise.activerecord51? method 2025-12-31 15:35:31 -03:00
Carlos Antonio da Silva
fc466316df Ensure auth keys at the start of the i18n msg are properly cased
Otherwise if we humanized the whole string, it could cause us to change
the output of strings with periods and maybe other side-effects, since
we're changing the whole string from i18n.

This is safer as it only changes the first char of the translated
message, and only if it is a match with the first translated auth key,
so we can more safely humanize & downcase all auth keys to interpolate
in the message whenever needed.

Also add changelog for the change.
2025-12-31 14:46:34 -03:00
Julius Graakjær Grantzau
356b094312 Downcase authentication keys and humanize error message (#4834)
"Invalid Email or password." is grammatically incorrect, a change
introduced a while ago by #4014.

Signed-off-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2025-12-31 14:40:36 -03:00
Adan Amarillas
9a149ff139 Return 401 for sessions#destroy action with no user signed in (#4878)
It's an unauthenticated request, so return 401 Unauthorized like most
other similar requests.

Signed-off-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2025-12-31 13:56:01 -03:00
Shriram
05bbc71446 Make secure_compare handle empty strings comparison correctly
Used Rails' secure_compare method inside the definition of
secure_compare. This will handle the empty strings comparison and
return true when both the parameters are empty strings.

Fixes #4441, #4829
2025-12-31 11:51:20 -03:00
Taketo Takashima
8054ad55c3 Use :unprocessable_content in generated Devise config for Rack 3.1+, avoid Rack warnings (#5797)
In Rack v3.1.0, the symbol for HTTP status code 422 was changed from `:unprocessable_entity` to `:unprocessable_content`.

As a result, when using rack 3.2 with the following configuration in `config/initializers/devise.rb`, a warning is shown on login failure:

```ruby
# config/initializers/devise.rb
Devise.setup do |config|
  ...
  config.responder.error_status = :unprocessable_entity
```

Warning message:

```sh
/path-to-app/vendor/bundle/ruby/3.4.0/gems/devise-4.9.4/lib/devise/failure_app.rb:80: warning: Status code :unprocessable_entity is deprecated and will be removed in a future version of Rack. Please use :unprocessable_content instead.
```

This warning can be resolved by updating the config as follows:
```diff
# config/initializers/devise.rb
Devise.setup do |config|
  ...
+  config.responder.error_status = :unprocessable_content
-  config.responder.error_status = :unprocessable_entity
```

This fixes the root cause of the warning for new apps by adjusting the generated config during `$ rails generate devise:install` depending on the rack version, so new apps using newer Rack versions generate `error_status = :unprocessable_content` instead of `:unprocessable_entity`.

Existing apps are handled by [latest versions of Rails, which will now transparently convert the code under the hood to avoid the Rack warning](https://github.com/rails/rails/pull/53383), and Devise will use that translation layer when available in the failure app to prevent the warning there as well (since that isn't covered by Rails automatic conversion).

Signed-off-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2025-12-31 10:45:09 -03:00
Carlos Antonio da Silva
d13ef89afb Replace [data-turbo-cache=false] with [data-turbo-temporary]
The default `_error_messages.html.erb` partial uses a deprecated Turbo
attribute `data-turbo-cache=false`, which was deprecated on Feb 15 2023
in [this pull request](https://github.com/hotwired/turbo/pull/871).

Use more up-to-date attribute name called
[data-turbo-temporary](https://github.com/hotwired/turbo/pull/871) to
avoid deprecation issues and reduce developer confusion as
`data-turbo-temporary` is the only attributed mentioned in
[Turbo Drive's documentation](https://turbo.hotwired.dev/handbook/building#preparing-the-page-to-be-cached)

Closes #5664
Closes #5662

Signed-off-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2025-12-31 09:26:09 -03:00
Carlos Antonio da Silva
051f94a498 Pass locale with activatable / timeoutable hooks (#5815)
We need to explicitly pass the `locale` around from the options (passed
to `warden.authenticate!` for instance) or the `I18n.locale` when
logging out and redirecting the user via `throw :warden`, otherwise in a
multi-locale app we'd lose the locale previously set / passed around and
fallback to the default for that flash message.

This is a follow-up of the fixes in #5567 where we implemented the
locale passing logic down to the failure app, but it missed these places
where we were using `throw :warden`.

Closes #5812
2025-12-31 09:12:25 -03:00
nkroker
cd9c21a067 Fix message in controllers generator
Closes #5814

Signed-off-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2025-12-29 17:41:54 -03:00
Carlos Antonio da Silva
6f8f38d795 Update dependencies and test with Ruby 4.0
https://www.ruby-lang.org/en/news/2025/12/25/ruby-4-0-0-released/

We need to add `ostruct` as a dev dependency because it doesn't come
as a default gem with Ruby 4.0 anymore.

Lock minitest < 6 since v6 has some incompatibilities with released
versions of Rails that will be fixed in future versions.

This is something I didn't run into a few other gems, but SimpleForm
did, presumabily because it touches additional areas like AV tests.
2025-12-29 17:37:19 -03:00
dependabot[bot]
c8a64b549c Bump actions/checkout from 5 to 6 (#5809)
* Bump actions/checkout from 5 to 6

Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...


* Bump supercharge/mongodb-github-action from 1.12.0 to 1.12.1 (#5808)

Bumps [supercharge/mongodb-github-action](https://github.com/supercharge/mongodb-github-action) from 1.12.0 to 1.12.1.
- [Release notes](https://github.com/supercharge/mongodb-github-action/releases)
- [Changelog](https://github.com/supercharge/mongodb-github-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/supercharge/mongodb-github-action/compare/1.12.0...1.12.1)

---
updated-dependencies:
- dependency-name: supercharge/mongodb-github-action
  dependency-version: 1.12.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
...


Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-24 15:39:11 -03:00
Carlos Antonio da Silva
95618806c4 Remove no longer relevant test for mass assignment sanitization
This is no longer in Rails since v5, it's been extracted to
`protected_attributes`, and we're dropping support to older versions of
Rails in main.

https://github.com/rails/protected_attributes
2025-11-14 11:24:30 -03:00
Carlos Antonio da Silva
47e8716493 Remove post-install message
Hopefully by now everyone should've upgraded and figured this out.

[ci skip]
2025-11-14 10:38:10 -03:00
Carlos Antonio da Silva
c6b08ae7e1 Bump actions/checkout and mongodb-github-action
Bump actions/checkout from 3 to 5 (#5805)

Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 5.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '5'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Bump supercharge/mongodb-github-action from 1.11.0 to 1.12.0 (#5804)

Bumps [supercharge/mongodb-github-action](https://github.com/supercharge/mongodb-github-action) from 1.11.0 to 1.12.0.
- [Release notes](https://github.com/supercharge/mongodb-github-action/releases)
- [Changelog](https://github.com/supercharge/mongodb-github-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/supercharge/mongodb-github-action/compare/1.11.0...1.12.0)

---
updated-dependencies:
- dependency-name: supercharge/mongodb-github-action
  dependency-version: 1.12.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-11-03 18:52:57 -03:00
Carlos Antonio da Silva
ef2d4831ef Add missing frozen string literal comment to file [ci skip] 2025-10-31 15:14:34 -03:00
Carlos Antonio da Silva
97cf37eb56 Expand changelog [ci skip] 2025-10-31 15:03:46 -03:00
Carlos Antonio da Silva
b0867c998c Remove deprecated stuff (#5803)
All of these have been deprecated for years, if we're releasing a new
major version, let's take the opportunity to do some cleanup.

* Remove deprecated `:bypass` option from `sign_in` helper,
  use `bypass_sign_in` instead.
* Remove deprecated `devise_error_messages!` helper,
  use `render "devise/shared/error_messages", resource: resource` instead.
* Remove deprecated `scope` second argument from `sign_in(resource, :admin)`
  controller test helper, use `sign_in(resource, scope: :admin)` instead.
* Remove deprecated `Devise::TestHelpers`,
  use `Devise::Test::ControllerHelpers` instead.

Closes #5739
2025-10-31 13:52:34 -03:00
Carlos Antonio da Silva
fa052e5064 Remove some mongoid version checks from test suite
We no longer run against or support old Mongoid versions.
2025-10-31 11:26:19 -03:00
Carlos Antonio da Silva
dd7ee27f74 Bring back Mongoid official support (#5568)
Devise hasn't been tested with Mongoid since Rails version 5, only 4.x was still running those tests.

This enables the tests again on all currently supported Rails versions, with their respective mongoid supported versions. There were a couple of minor tweaks to make it happen, namely:

* The way we were dropping the session before doesn't work in later versions so I changed back to calling `purge!` which appears to work fine. We used to call `Mongoid.purge!` but that changed in #4686.
* Some of the configs in the Rails test app were setting Active Record values when outside of the AR ORM tests, updated those to make sure they are not set when running mongoid ORM tests.
* The validations added to the shared admin code in tests were only checking for Rails version 5.1, but we need to use the same check for AR 5.1 that is used in code, otherwise it will try to use methods not available in mongoid there.
2025-10-31 11:16:02 -03:00
Fuyutsubaki
b76d18d277 Fixed inconsistency between description and example in 'Running tests' section (#5802)
Expand test run examples to show running a specific line number or a matching regex.

[ci skip]
2025-10-31 09:44:11 -03:00
Carlos Antonio da Silva
f150357c1c Test with the released version of v7.0
Rails just released v7.0.10 which contains the fixes for Ruby 3.4 we
needed to get the build green, so no need to point to GH anymore.

https://rubyonrails.org/2025/10/29/new-rails-releases-and-end-of-support-announcement

Note that v7.0 has reached EOL for a while now.
2025-10-29 10:31:23 -03:00
Carlos Antonio da Silva
d60f810086 Use currently released version of rails-controller-testing
We pointed to github to fix issues with Ruby 2.7 and kwargs, but since
then a version 1.0.5 was released which includes those fixes.

There's a few more things in their main, but nothing we need if all is
green.
2025-10-24 11:36:46 -03:00
Carlos Antonio da Silva
5a82ad5740 Fix nokogiri deprecation warning
./devise/test/support/webrat/matchers.rb:6: warning:
    Nokogiri::CSS.parse is deprecated and will be removed in a future
    version of Nokogiri. Use Nokogiri::CSS::Parser#parse instead.
2025-10-24 11:33:57 -03:00
Carlos Antonio da Silva
1cf31d45eb Update to test with Rails v8.1.0 final 2025-10-24 11:23:10 -03:00
Carlos Antonio da Silva
141ef37339 Add Ruby 3.4 & build updates (#5801)
Update bundle to avoid 3.4 mutex_m require error.

Test against Rails 7.0 branch which contains Ruby 3.4 fixes.

Update changelog to mention Rails < 7.0 support being dropped.

Builds on top of https://github.com/heartcombo/devise/pull/5770
Closes https://github.com/heartcombo/devise/pull/5776
Closes https://github.com/heartcombo/devise/pull/5761
2025-10-21 17:28:05 -03:00
Greg Molnar
dbc8e77ea0 Make test suite work (#5770)
* Drop support for Rails < 7 and Ruby < 2.7
* Add tests to support to Rails 8+
* Fix test suite across all supported versions
2025-10-21 16:52:04 -03:00
Carlos Antonio da Silva
9c5e4d3c4e Update to new email, copyright, supported Ruby/Rails versions
Also remove contributors section and add supported ruby/rails versions
to the readme.

[ci skip]
2025-10-17 14:22:02 -03:00
soma-git-practice
fa4749dddc Expand reconfirmable comment on generator to match the module doc (#5748)
Explain the combined usage of `reconfirmable` with `send_email_changed_notification`.
[ci skip]
2025-10-17 13:41:42 -03:00
Carlos Antonio da Silva
b02bb5b75a Merge pull request #5746 from c960657/config-warden
Update argument name for config.warden [ci skip]

The argument for the block passed to `config.warden` is no a `Warden::Manager` instance but a `Warden::Config` instance, but it is confusingly named `manager` in the generated file.

Renaming this to `warden_config` for clarity.
2025-10-17 12:06:43 -03:00
Carlos Antonio da Silva
23058dcc62 Merge pull request #5738 from soma-git-practice/is_this_typo_models_in_lockable
Fix typo in comments [ci skip]
2025-10-16 10:17:40 -03:00
Carlos Antonio da Silva
cf93de390a Fix links to RubyDoc
Closes #5778
[ci skip]
2025-05-28 08:51:42 -03:00
Christian Schmidt
46cae66baf Update argument name for config.warden 2024-12-17 13:31:17 +01:00
soma
a78ad3f20c Fix typo in comments 2024-12-04 23:04:03 +09:00
Vasiliy Ermolovich
fec67f98f2 Merge pull request #5734 from heartcombo/password-length-dynamic
Use proc to set password length validator so it's possible to override it dynamically.
2024-11-29 13:15:22 +00:00
Vasiliy Ermolovich
560a1cb16f Use proc to set password length validation so it's possible to override it dynamically.
Co-authored-by: Manoj M J <manojmj92@gmail.com>
2024-11-29 14:10:07 +01:00
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 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
Rafael Mendonça França
a7d64ae313 Merge pull request #5583 from etiennebarrie/deprecator
Use a dedicated ActiveSupport::Deprecation
2023-10-10 11:29:29 -03:00
Carlos Antonio da Silva
34cb23ed9c Fix mocha warnings with hash vs kwargs 2023-10-10 11:29:27 -03:00
Carlos Antonio da Silva
14aa380d80 Update mocha to fix issue with Minitest compatibility layer
There's a number of deprecation warnings to work through related to
mocha updates in v2+, we'll get through those on a separate change.
https://github.com/freerange/mocha/blob/main/RELEASE.md#200

The main issue is with Minitest, fixed in v2.1:
https://github.com/freerange/mocha/blob/main/RELEASE.md#210

Also run `bundle update` on the main Gemfile to update all dependencies
there to latest.
2023-10-10 10:51:46 -03:00
Carlos Antonio da Silva
c4c8fad66c Use Rails 7.1 on main Gemfile and create a new one for 7.0 2023-10-10 10:51:46 -03:00
Carlos Antonio da Silva
f6e73e5b5c Merge pull request #5628 from soartec-lab/fix/dedicated_active_support_deprecation
Fixed missing migration to dedicated deprecator
2023-09-12 21:39:56 -03:00
soartec-lab
f8f035155b Fixed missing migration to dedicated deprecator 2023-09-12 11:10:32 +09:00
Carlos Antonio da Silva
9f80dc2562 Merge pull request #5621 from santu-essence/code-improvement/minor-changes
Inherit from only base.
2023-08-17 10:16:42 -03:00
santu essence
5b22538ae5 Inherit from only base. 2023-08-17 10:25:06 +05:30
Rafael Mendonça França
ec0674523e Merge pull request #5416 from DerekCrosson/main
Make copying and pasting terminal commands easier
2023-06-09 19:58:00 -04:00
Rafael Mendonça França
1b0ef1d2fe Merge pull request #5508 from Edouard-chin/ec-omniauth-allowed-methods
Use Omniauth.allowed_methods' as routing verbs for the auth path:
2023-06-09 19:50:07 -04:00
Edouard CHIN
4f82235630 Use Omniauth.allowed_methods' as routing verbs for the auth path:
- ### Context

  Since version 2.0.0, Omniauth no longer recognizes `GET` request
  on the auth path (`/users/auth/<provider>`). `POST` is the only
  verb that is by default recognized in order to mitigate CSRF
  attack. 66110da85e/lib/omniauth/strategy.rb (L205)

  Ultimatelly, when a user try to access `GET /users/auth/facebook`,
  Devise [passthru action](6d32d2447c/app/controllers/devise/omniauth_callbacks_controller.rb (L6))
  will be called which just return a raw 404 page.

  ### Problem

  There is no problem per se and everything work. However the
  advantage of not matching GET request at the router layer allows
  to get that same 404 page stylized for "free" (Rails ending up
  rendering the 404 page of the app).

  I believe it's also more consistent and less surprising for users
  if this passthru action don't get called.

  ### Drawback

  An application can no longer override the `passthru` to perform
  the logic it wants (i.e. redirect the user).

  If this is a dealbreaker, feel free to close this PR :).
2023-06-09 23:46:12 +00:00
Rafael Mendonça França
8bb41ad98e Merge pull request #5601 from heartcombo/dependabot/github_actions/supercharge/mongodb-github-action-1.9.0
Bump supercharge/mongodb-github-action from 1.3.0 to 1.9.0
2023-06-09 19:43:28 -04:00
Rafael Mendonça França
e81ec9c436 Merge pull request #5595 from louim/bugfix/mailer-defaults-lambda-arity
Make sure Mailer defaults :from and :reply_to are handled correctly
2023-06-09 19:42:53 -04:00
Louis-Michel Couture
ed1c2a1adb Make sure Mailer defaults :from and :reply_to are handled correctly
Rails allow procs and lambda with either zero or more argument. Devise
however always tried to call instance_eval on those values, which does
always pass one argument: self.

There was a PR to fix this specific problem in Devise https://github.com/heartcombo/devise/pull/4627,
before the arity check was fixed in rails itself: https://github.com/rails/rails/pull/30391.

But even if the problem was fixed in Rails, Devise was still calling
the proc/lambas with instance_eval. That meant the fix added to Rails
did not apply to Devise.

The fix is to let Rails handle the :from and :reply_to defaults. We do
that by unsetting the headers instead of trying to replicate Rails handling
in Devise. This lets Rails handle it when setting up the mailer.
2023-06-09 23:30:51 +00:00
Rafael Mendonça França
9be24c0ae4 Merge pull request #5598 from soartec-lab/task/removed-older-deprecation-warning
Removed deprecations warning output for `Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION`
2023-06-09 19:24:40 -04:00
Rafael Mendonça França
19d9dabc80 Merge pull request #5480 from glaucocustodio/patch-1
Use bundle add instead
2023-06-09 19:23:39 -04:00
dependabot[bot]
285dc5d2fc Bump supercharge/mongodb-github-action from 1.3.0 to 1.9.0
Bumps [supercharge/mongodb-github-action](https://github.com/supercharge/mongodb-github-action) from 1.3.0 to 1.9.0.
- [Release notes](https://github.com/supercharge/mongodb-github-action/releases)
- [Changelog](https://github.com/supercharge/mongodb-github-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/supercharge/mongodb-github-action/compare/1.3.0...1.9.0)

---
updated-dependencies:
- dependency-name: supercharge/mongodb-github-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-09 23:23:28 +00:00
Rafael Mendonça França
aeb24bf804 Merge pull request #5504 from petergoldstein/feature/add_dependabot_for_github_actions
Add Dependabot for GitHub Actions
2023-06-09 19:23:08 -04:00
Rafael Mendonça França
aca0b24118 Merge pull request #5494 from iainbeeston/br-has-no-closing-slash
Replaced `<br/>` with `<br>`
2023-06-09 19:22:46 -04:00
soartec-lab
e524a3d22d Removed deprecations warning output for Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION 2023-06-09 23:20:47 +00:00
Iain Beeston
1a3d1ae350 Replaced <br/> with paragraph tags
In regular HTML `<br>` is a void element, so it

Many of the shared templates used by devise use `<br/>`
to separate lines, which is invalid html because `<br>`
doesn't need a closing tag or a closing slash. See the
WhatWG spec here:
https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-br-element

Also, the WhatWG spec uses `<p>` tags to separate
`<label>` and `<input>` tags rather than `<br>`, see
here:
https://html.spec.whatwg.org/multipage/input.html

To clean this up I've replaced `<br/>` with paragraph
tags throughout all of the templates.

This reverts b86c1c241b
2023-06-09 22:36:51 +00:00
Rafael Mendonça França
fc731a88bb Add devcontainer configuration
This will allow contributors to setup their environment using VS Code
container or Codebases.
2023-06-09 22:34:44 +00:00
Rafael Mendonça França
6d058bfde8 Fix tests after #5515 2023-06-09 22:34:19 +00:00
Rafael Mendonça França
ad172bd547 Merge pull request #5599 from etiennebarrie/rails-edge-deprecations
Fix Rails main deprecations
2023-06-09 18:16:49 -04:00
Rafael Mendonça França
1195c6f0d6 Merge pull request #5515 from okyanusoz/patch-1
Fix a grammatical error
2023-06-09 18:16:38 -04:00
Rafael Mendonça França
54a624a34b Merge pull request #5583 from etiennebarrie/deprecator
Use a dedicated ActiveSupport::Deprecation
2023-06-09 18:12:01 -04:00
Étienne Barrié
48e115334b Remove MigrationContext deprecation in 7.1
DEPRECATION WARNING: SchemaMigration no longer inherits from
ActiveRecord::Base. If you want to use the default connection, remove
this argument. If you want to use a specific connection, instantiate
MigrationContext with the connection's schema migration, for example
`MigrationContext.new(path, Dog.connection.schema_migration)`.
2023-06-08 11:49:34 +02:00
Étienne Barrié
c809adeeed Use show_exceptions = :none in Rails 7.1
DEPRECATION WARNING: Setting action_dispatch.show_exceptions to false is
deprecated. Set to :none instead.
2023-06-08 11:49:19 +02:00
Étienne Barrié
e1298c87d7 Add deprecator to the application's deprecators 2023-06-08 11:30:38 +02:00
Étienne Barrié
882dd70a9f Use a dedicated ActiveSupport::Deprecation
Rails 7.1 will deprecate using the singleton ActiveSupport::Deprecation
instance. This defines one for the gem and uses it.
2023-04-07 00:15:10 +02:00
Carlos Antonio da Silva
4b72064bfc Add missing changelog version [ci skip] 2023-04-03 09:25:06 -03:00
Carlos Antonio da Silva
8b0b849a67 Release v4.9.2 2023-04-03 09:23:02 -03:00
Carlos Antonio da Silva
4f849f4fa9 Bring back `Devise.activerecord51? and deprecate it
Even though this is considered an internal / non-public / nodoc method,
it seems some libraries relied on it internally, causing some breakage.

Known libraries so far are `devise-security` and
`devise-pwned_password`.

Closes #5580
2023-04-03 09:21:56 -03:00
Carlos Antonio da Silva
3926e6d9eb Release v4.9.1 2023-03-31 09:39:17 -03:00
Carlos Antonio da Silva
506eaf495d Merge pull request #5576 from heartcombo/ca-multiple-orms
Improve support for Devise in apps with multiple ORMs loaded
2023-03-30 17:54:30 -03:00
Carlos Antonio da Silva
8dbe5b2fe8 Merge pull request #5573 from heartcombo/ca/failure-app-respect-redirect
Respect redirect status code when recalling the action
2023-03-30 17:29:35 -03:00
Carlos Antonio da Silva
207ddc5127 Improve support for Devise in apps with multiple ORMs loaded
Devise is able to work with a specific ORM, either Active Record or
Mongoid, but nothing stops apps from using multiple ORMs within the same
application -- they just need to pick one to use with Devise. That's
generally determined by the require that is added to the Devise
initializer, that will load up either ORM's extensions so you can call
things like `devise` on your model to set it up.

However, some conditional logic in Devise, more specifically around
dirty tracking, was only considering having Active Record loaded up
after a certain version, to determine which methods to call in parts of
the implementation. In a previous change we refactored all that dirty
tracking code into this `OrmDirtyTracking` module to make it easier to
view all the methods that were being conditionally called, and now we're
repurposing this into a more generic `Orm` module (that's nodoc'ed by
default) so that upon including it, we can conditionally include the
proper dirty tracking extensions but also check whether the including
model is really Active Record or not, so we can trigger the correct
dirty tracking behavior for Mongoid as well if both are loaded on the
same app, whereas previously the Mongoid behavior would always use the
new Active Record behavior, but support may differ.

While we are also working to ensure the latest versions of Mongoid are
fully running with Devise, this should improve the situation by giving
apps with multiple ORMs loaded a chance to rely on some of these Devise
bits of functionality better now that weren't working properly before
without some monkey-patching on their end.

Closes #5539
Closes #4542
2023-03-23 19:16:23 -03:00
Carlos Antonio da Silva
367ea42762 Refactor dirty tracking conditionals for different versions (#5575)
We have an number of conditions due to how dirty tracking changed around
Rails 5.1, that implement methods using one or another method call. I
might need more of this for mongo upgrades based on an initial
investigation, plus this makes the code really hard to reason about
sometimes with these many conditionals.

While I want to drop support for older versions of Rails soon, this
centralization of dirty methods that are used by devise conditionally
simplifies the usage considerably across the board, moves the version
condition to a single place, and will make it easier to refactor later
once we drop older Rails version by simply removing the `devise_*`
versions of the methods, alongside the prefix on the method calls for
the most part, since those methods follow the naming of the newer Rails
versions.
2023-03-23 19:11:11 -03:00
Carlos Antonio da Silva
89a08357d6 Uses the responder redirect_status when recall returns a redirect
It appears some people use the recall functionality with a redirect
response, and Devise starting on version 4.9 was overriding that status
code to the configured `error_status` for better Turbo support, which
broke the redirect functionality / expectation.

While I don't think it's really great usage of the recall functionality,
or at least it was unexpected usage, it's been working like that
basically forever where recalling would use the status code of the
recalled action, so this at least keeps it more consistent with that
behavior by respecting redirects and keeping that response as a redirect
based on the configured status, which should also work with Turbo I
believe, and makes this less of a breaking change.

Closes #5570
Closes #5561 (it was closed previously, but related / closes with an
actual change now.)
2023-03-20 18:18:54 -03:00
Carlos Antonio da Silva
eed51179c7 Add explicit test for respecting the error_status responder config
While introducing this on turbo, looks like no specific test was added,
so this at least covers that a bit.

It needs some conditional checks since not all supported Rails +
Responders version work with the customization, so there's one test for
the hardcoded status version too, which can be removed in the future.
2023-03-20 17:58:48 -03:00
Peter Goldstein
11b6a99e88 Add Dependabot for GitHub Actions 2023-03-19 12:55:13 -04:00
Carlos Antonio da Silva
232c855c54 Fix tests with Rails main
Rails main / 7.1.0.alpha introduced a change to improve typography by
default, by converting all apostrophes to be single quotation marks.
https://github.com/rails/rails/pull/45463

The change caused all our text based matching to fail, this updates the
tests to ensure compatibility.

Model tests were changed to test against the error type & information
rather than the translated string, which I think is an improvement
overall that should make them a little less brittle. I thought of using
[of_kind?] but that isn't available on all Rails versions we currently
support, while `added?` is. The drawback is that `added?` require full
details like the `:confirmation` example which requires the related
attribute that is being confirmed, but that's a small price to pay.

Integration tests were changed to match on a regexp that accepts both
quotes. I could've used a simple `.` to match anything there, but
thought I'd just keep it specific for clarity on what it is really
expected to match there. Plus, since it's integration testing against a
rendered response body, it's better to match the actual text rather than
resort on other ways. (like using I18n directly, etc.)

[of_kind?] https://api.rubyonrails.org/classes/ActiveModel/Errors.html#method-i-of_kind-3F
2023-03-17 10:59:55 -03:00
Carlos Antonio da Silva
afec6655c7 Update bundle 2023-03-17 10:59:51 -03:00
Carlos Antonio da Silva
7d1dc56fdb Merge branch 'ca-replace-refute-assert-not'
Prefer `assert_not*` helpers.

Closes #5158
2023-03-02 19:15:18 -03:00
Carlos Antonio da Silva
890bd9e3b5 Replace usage of assert ! with actual assert_not helper 2023-03-02 18:41:44 -03:00
Carlos Antonio da Silva
1e63c640c0 Update a few other instances that were using refute methods
Prefer assert_not* in general.
2023-03-02 18:40:35 -03:00
tabakazu
8acbdd6d93 Replace matcher refute to assert_not 2023-03-02 18:38:04 -03:00
Carlos Antonio da Silva
400eaf7fbe Remove not used constant
It's only been almost ~10 years since we removed it's usage. :D
dff7891b97
2023-03-01 22:50:56 -03:00
Carlos Antonio da Silva
df8b79a53f Fix added tests for sign_in_after_reset_password per resource class
We can't just "swap" those model properties, as that sets instance vars
on the classes that get reverted to their "previous" value, which ends
up leaving the instance vars set as `nil`. However, our logic for those
model/class properties actually checks for `defined?` as a way to
override them, and delegates up to `Devise` global config if they are
not defined, so leaving instance vars back with `nil` values isn't
enough, we need to actually remove them.

This introduces a new test helper specifically for overriding those
model configs so that we can do proper cleanup.
2023-03-01 22:50:03 -03:00
Carlos Antonio da Silva
ef6c73b221 Merge branch 'feature/password-reset-configuration'
Closes #5429
2023-03-01 22:20:54 -03:00
Carlos Antonio da Silva
c7a719a979 Add changelog for #5429
[ci skip]
2023-03-01 22:20:37 -03:00
Matt Redmond
60c5774ff4 Delegate sign_in_after_reset_password to resource class
Allows resource class scopes to overrides the global configuration for sign in after reset password behaviour.
2023-03-01 22:18:16 -03:00
Peter Goldstein
90f46bac37 Monkeypatch webrat for Nokogiri compatibility
This is an attempt to address the Webrat / Nokogiri compatibility issue
[discussed here]. It monkeypatches Webrat to explicitly add the old
default arguments to the invocation of to_xpath.

Move monkey patch to its own file under test/support/webrat.
I really need to get rid of webrat.

Closes #5475

[discussed here] https://github.com/sparklemotion/nokogiri/issues/2469
2023-03-01 22:06:40 -03:00
Carlos Antonio da Silva
ee8f0f8e83 Fix frozen string in validatable, use multiline string instead. (#5563)
Expand tests to check for the actual validatable exception message

This was raising a `FrozenError` on Ruby < 3 where interpolated strings
were considered frozen. This [changed in Ruby 3], since such strings are
dynamic there's no point in freezing them by default.

The test wasn't catching this because `FrozenError` actually inherits
from `RuntimeError`:

>> FrozenError.ancestors
=> [FrozenError, RuntimeError, StandardError, Exception, Object ...]

So the exception check passed. Now we're also checking for the error
message to ensure it raised the exception we really expected there.

Closes #5465

[changed in Ruby 3] https://bugs.ruby-lang.org/issues/17104

Co-authored-by: Martin <martin@edv-beratung-meier.de>
2023-03-01 19:56:25 -03:00
Carlos Antonio da Silva
41e2db2120 It is not required to copy the views when customizing controllers
It is indeed recommended for consistency, but Rails will be able to find
the views under `devise/` due to inheritance still, so make that a bit
clearer in the readme docs about customizing controllers, explaining
that copying or moving the views is an optional step.

Closes #5526
[ci skip]
2023-02-20 10:26:59 -03:00
Carlos Antonio da Silva
7f419bf99a Release Devise v4.9.0 2023-02-17 11:14:03 -03:00
Carlos Antonio da Silva
44f0fd741f Update copyright year [ci skip]
Closes #5556
2023-02-16 09:10:59 -03:00
Carlos Antonio da Silva
2d655ea46e Merge pull request #5554 from JunichiIto/fix-unhappy-markup
Remove p tag since p tags cannot contain other block elements
2023-02-14 08:58:23 -03:00
Junichi Ito
49ed129c40 Replce p tag with div since p tags cannot contain other block elements 2023-02-14 08:34:26 +09:00
Carlos Antonio da Silva
8e2e3f6fda Merge pull request #5548 from heartcombo/ca-turbo
Integrate with Hotwire/Turbo by configuring error and response statuses
2023-02-09 18:14:01 -03:00
Carlos Antonio da Silva
31c4f31ef4 Tweak comment about overriding Devise.responder
Albeit it's not super recommended, it's possible and even mentioned in
the changelog/wiki in case the app has some additional responder logic
that needs to be applied to Devise across the board.
2023-02-09 08:51:42 -03:00
Carlos Antonio da Silva
8606e1e671 Expand changelog/readme with info about Turbo vs rails-ujs behavior
Explain a bit more about how `data-confirm` and `data-method` need to be
updated to the turbo versions `data-turbo-confirm` and
`data-turbo-method`, respectively. (and depending on its usage.)

[ci skip]
2023-02-07 11:05:53 -03:00
Carlos Antonio da Silva
2df5efcece Add post install message pointing to the changelog and new upgrade guide
There's some additional information in the wiki upgrade guide for those
interested, but most of it is covered in the changelog and should
suffice.

The post install message should help guide people upgrading to make sure
they know what to do in this new version, since some may be using Turbo
out there with custom responders and failure apps and those would have
to be removed in order to use these new changes fully. Hopefully that's
enough of a nudge for them.
2023-02-03 15:41:30 -03:00
Carlos Antonio da Silva
43c349a2fc Point version to v4.9.0.alpha for now
Just want to have something different than the currently released
version to test out more easily. Plus, this is probably going to become
v4.9.0 final soon anyway.
2023-02-03 15:26:24 -03:00
Carlos Antonio da Silva
0d392fa49f Use the released version of responders v3.1.0
Unfortunately we can't enforce the version in the gemspec because
responders only supports Rails 5.2 now, and Devise still supports
previous versions.

We'll drop support for those in a future major release, so for now I'm
not adding any version.

This also adds a warning in case someone is using an older version of
responders and tries to set the error/redirect statuses via Devise, so
that they know what to do (upgrade responders) in that case.
2023-02-03 14:09:42 -03:00
Carlos Antonio da Silva
d0f0853c75 Remove CodeClimate badge
It's not working right now, and we haven't used it in like forever
to drive anything.

Closes #5549

[ci skip]
2023-02-03 11:50:42 -03:00
Carlos Antonio da Silva
88625d488f Use button_to to generate a POST form, disable turbo with OmniAuth
This changes the OmniAuth "sign in" links to use buttons, which can be
wrapped in an actual HTML form with a method POST, making them work
better with and without Turbo in the app. It doesn't require rails/ujs
anymore in case of a non-Turbo app, as it previously did with links +
method=POST.

Turbo is disabled for those OmniAuth buttons, as they simply don't work
trying to follow the redirect to the OmniAuth provider via fetch,
causing CORS issues/errors.
2023-02-01 11:29:17 -03:00
Carlos Antonio da Silva
f08e0ad24a Integrate with Hotwire/Turbo by configuring error and response statuses
Treat `:turbo_stream` request format as a navigational format, much like
HTML, so Devise/responders can work properly.

Allow configuring the `error_status` and `redirect_status` using the
latest responders features, via a new custom Devise responder, so we can
customize the both responses to match Hotwire/Turbo behavior, for
example with `422 Unprocessable Entity` and `303 See Other`,
respectively. The defaults aren't changing in Devise itself (yet), so it
still responds on errors cases with `200 OK`, and redirects on non-GET
requests with `302 Found`, but new apps are generated with the new
statuses and existing apps can opt-in. Please note that these defaults
might change in a future release of Devise.

PRs/Issues references:

https://github.com/heartcombo/devise/pull/5545
https://github.com/heartcombo/devise/pull/5529
https://github.com/heartcombo/devise/pull/5516
https://github.com/heartcombo/devise/pull/5499
https://github.com/heartcombo/devise/pull/5487
https://github.com/heartcombo/devise/pull/5467
https://github.com/heartcombo/devise/pull/5440
https://github.com/heartcombo/devise/pull/5410
https://github.com/heartcombo/devise/pull/5340

https://github.com/heartcombo/devise/issues/5542
https://github.com/heartcombo/devise/issues/5530
https://github.com/heartcombo/devise/issues/5519
https://github.com/heartcombo/devise/issues/5513
https://github.com/heartcombo/devise/issues/5478
https://github.com/heartcombo/devise/issues/5468
https://github.com/heartcombo/devise/issues/5463
https://github.com/heartcombo/devise/issues/5458
https://github.com/heartcombo/devise/issues/5448
https://github.com/heartcombo/devise/issues/5446
https://github.com/heartcombo/devise/issues/5439
2023-01-31 11:02:01 -03:00
Carlos Antonio da Silva
3632ddf674 Remove XML serializer from a couple gemfiles missed previously
It looks like I missed removing it when XMl was replaced with JSON
across our test suite in a793472a3e.
2023-01-31 10:12:24 -03:00
Carlos Antonio da Silva
cddba28945 Bundle update 2023-01-27 17:15:20 -03:00
Carlos Antonio da Silva
032c4476ae Merge branch 'ca-build' 2023-01-19 11:44:25 -03:00
Carlos Antonio da Silva
319d9fa648 Run with the latest rubygems on newer Ruby versions
Rails master on Ruby 2.7/3.0 is failing with the following error:

    Resolving dependencies...
    Could not find compatible versions
    Because every version of rails depends on RubyGems >= 3.3.13
      and Gemfile-rails-main depends on rails >= 0,
      RubyGems >= 3.3.13 is required.
    So, because current RubyGems version is = 3.1.6,
      version solving has failed.

Trying to run with the latest available rubygems to see if that can fix
the problem, but sticking to the "default" rubygems version on older
Ruby versions to avoid build issues there.
2023-01-19 09:58:53 -03:00
Carlos Antonio da Silva
59bedaa1e7 Attempt to get the build running on Ruby 2.2
It appears we're getting a newer version of this multipart-post
dependency, which doesn't work well with Ruby 2.2 by using
`Object.deprecate_constant`, resulting in the following error:

    .../multipart-post-2.2.0/lib/multipart/post/parts.rb:152:in `<top (required)>':
    undefined method `deprecate_constant' for Object:Class (NoMethodError)

Hopefully by locking on a previous version we can just get the build
back to green for now.
2023-01-17 14:47:26 -03:00
Carlos Antonio da Silva
fc1ac76ddf Add support to Ruby 3.2 (no changes needed) 2023-01-17 14:29:38 -03:00
okyanusoz
41003bf5de Update new.html.erb 2022-08-30 17:06:16 +03:00
Carlos Antonio da Silva
6d32d2447c Merge pull request #5503 from ak15/main
Fix typo in lockable documentation
2022-06-27 10:37:35 -03:00
Atul Kanswal
d4bf52bdfd Update lockable.rb
Documentation Confusion
2022-06-27 16:28:03 +05:30
Carlos Antonio da Silva
f8d1ea90bc Merge pull request #5484 from heartcombo/ca-build
Fix build
2022-04-22 13:29:19 -03:00
Carlos Antonio da Silva
2fa9303ab3 Use new method to reset CSRF exposed via the request object
This simplifies the logic considerably, as we don't need to reach out to
what seems more internal-ish implementation of Rails with the
interaction between the request and controller objects.

b925880914
2022-04-22 12:56:10 -03:00
Carlos Antonio da Silva
b5172a0cdb Fix csrf cleanup for Rails 7.1 (main)
Rails implemented a CSRF token storage strategy to allow storing the
CSRF tokens outside of the sessios (for example, in an encrypted
cookie), and changed how the value is kept around during the request
cycle, by using a request.env value.

We still want to ensure the final session value is cleaned correctly in
the test, but the implementation needed to change since we can't simply
delete from the session anymore, we need to make sure we call the Rails
methods for resetting the current storage strategy so it works with all
of them.

https://github.com/rails/rails/pull/44283
2022-04-22 11:08:44 -03:00
Carlos Antonio da Silva
e1c53d6580 Check for empty response body on redirect with Rails main (future 7.1)
Rails is no longer returning a message with the response body on
redirects, just an empty body.

https://github.com/rails/rails/pull/44554
2022-04-22 09:30:58 -03:00
Carlos Antonio da Silva
875217d8c1 Only set property for Rails 7, it has been removed on master
https://github.com/rails/rails/pull/44827
2022-04-22 09:17:46 -03:00
Carlos Antonio da Silva
55eabee800 Use https source for github repos with Bundler 1.x
GitHub no longer supports the git:// protocol, which was the default in
Bundler 1.x.

From the build:

    The unauthenticated git protocol on port 9418 is no longer supported.
    Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/
    for more information.
2022-04-22 09:17:46 -03:00
Carlos Antonio da Silva
8d4c3647a7 Update bundle 2022-04-22 09:17:46 -03:00
Carlos Antonio da Silva
700284fc67 Merge pull request #5483 from yysaki/feature/main_branch_url
Update the urls which refer nonexistent master branch name in documentations
2022-04-21 15:22:11 -03:00
yysaki
1542b7da29 Update the urls which refer nonexistent master branch name in documentations 2022-04-21 23:29:30 +09:00
Glauco Custódio
a78948f53c Use bundle add instead
As per https://github.com/rubygems/rubygems/pull/5337, we can simplify the steps of adding a gem.
2022-03-21 12:10:43 +00:00
Carlos Antonio da Silva
451ff6d49c Reorganize test matrix & use latest bundler
* Rails and Ruby versions follow the most recent to oldest, except for
  Rails main, so we can keep the Gemfile the first one.
* Excluding specific matrix combinations based on the Gemfile first,
  Ruby version next, and keep the same order (most recent -> oldest)
* Quote all Ruby versions to keep things consistent. It's required for
  the '3.0' version to avoid the float issue where it'd use the latest
  3.x instead.
2022-02-25 14:50:01 -03:00
Carlos Antonio da Silva
542df3634b Merge pull request #5450 from petergoldstein/feature/add_ruby_3_1
Add Ruby 3.1 to CI matrix
2022-02-25 14:39:14 -03:00
Peter Goldstein
3c5acaf531 Add Ruby 3.1 to CI matrix. Lock to Nokogiri < 1.13 for webrat compatibility 2022-02-23 08:37:31 -08:00
Carlos Antonio da Silva
025b1c8734 Add date to v4.8.1 changelog [ci skip] 2021-12-16 08:08:57 -03:00
Carlos Antonio da Silva
43800b4b85 Bump to 4.8.1 with Rails 7 support
Also note in the Changelog that Turbo is not fully supported yet.
2021-12-16 08:04:21 -03:00
Carlos Antonio da Silva
baf5e00544 Merge pull request #5435 from dixpac/dix/rails_7
Add support for Rails 7
2021-12-16 08:02:18 -03:00
Dino Maric
289dd5f221 Add support for Rails 7
This commit adds support for latest Rails release.
2021-12-16 10:12:05 +01:00
Carlos Antonio da Silva
9f5b83750e Bundle update to Rails 7.0 rc1 2021-12-08 08:26:05 -03:00
Derek Crosson
1ac16b15e3 Merge pull request #1 from DerekCrosson/DerekCrosson-fix-change-commands-copied-to-clipboard
chore: remove dollar symbol from some commands
2021-11-01 02:48:16 +02:00
Derek Crosson
353d86e01c chore: remove dollar symbol from some commands
When you copy the commands that have the terminal beginning of line symbol in front of them you now no longer need to first delete this before running the command
2021-11-01 02:44:35 +02:00
Carlos Antonio da Silva
8593801130 Keep the constantize behavior consistent for versions prior to Rails 7
Use `AS::Dependencies` as before if we still can, otherwise use the new
direct `constantize` call for Rails 7+.

Leave a TODO to help remind us this can be removed once we drop support
to Rails versions prior to 7 in the future.
2021-10-08 08:33:47 -03:00
Carlos Antonio da Silva
bb879f7154 Merge branch 'ca-rails-main'
Add Rails 7 / main support
2021-10-07 20:23:21 -03:00
Carlos Antonio da Silva
772b74a657 Update Changelog adding Rails 7 support 2021-10-07 20:15:44 -03:00
Carlos Antonio da Silva
51bf327017 Refactor using helper to swap config 2021-10-07 19:06:33 -03:00
Carlos Antonio da Silva
14eb1362e3 Eliminate Rails 7 warning about Active Record legacy connection handling
DEPRECATION WARNING: Using legacy connection handling is deprecated.
    Please set `legacy_connection_handling` to `false` in your application.
2021-10-07 18:46:40 -03:00
Carlos Antonio da Silva
f3e8fd3baa Move the Gemfile to test with Rails 7.0 alpha2, fix session test issue
It appears setting the `rack.session` to a simple hash doesn't work
anymore as it now has a few additional methods Rails is relying on to
determine whether it's enabled or not:
https://github.com/rails/rails/pull/42231

Failure:
    NoMethodError: undefined method `enabled?' for {}:Hash
    rails (f55cdafe4b82) actionpack/lib/action_dispatch/middleware/flash.rb:62:in `commit_flash'

Turns we we don't seem to need to set `rack.session` for the tests here.
2021-10-07 18:08:16 -03:00
strobilomyces
a0ccc1cf96 Fix deprecated ActiveSupport::Dependencies.constantize (#5397)
Changes deprecated `ActiveSupport::Dependencies.constantize(model_name)` to `model_name.constantize`

Co-authored-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2021-10-07 17:27:37 -03:00
Alex Ghiculescu
b39faffde4 Test against Rails main and remove ActiveSupport::Dependencies.reference (#5357)
Remove `ActiveSupport::Dependencies.reference`

This was deleted from Rails: 14d4edd7c3

As far as I can tell, it was meant to add a performance boost at some point in the past but doesn't seem to do anything useful these days.
2021-10-07 17:18:37 -03:00
Carlos Antonio da Silva
366a428b2c Revise docs from #5405
Update a couple other modules that still referred to `devise_for` to
point to `devise`, and make all of them more consistent. We can only
mention `devise`, that should be clear enough about it being options
for the model method.
2021-10-06 19:20:07 -03:00
Carlos Antonio da Silva
7d103bc627 Merge pull request #5405 from chihaso/fix_comment_in_some_modules
Fix comment in some modules [ci skip]
2021-10-06 19:17:21 -03:00
chihaso
bdd2e7e24f Fix comment in some modules
- It says that the option is added to devise_for, but it is actually added to the devise method in the model.
2021-09-17 14:37:28 +09:00
Carlos Antonio da Silva
c82e4cf47b Merge pull request #5378 from nickhammond/patch-1
Add metadata for RubyGems
2021-05-08 10:19:35 -03:00
Nick Hammond
63ccdfb34a Add metadata for RubyGems 2021-05-06 16:33:39 -07:00
Carlos Antonio da Silva
2ee0068d77 Bundle update 2021-05-05 18:20:38 -03:00
Carlos Antonio da Silva
57d1a1d381 Release v4.8.0 2021-04-29 08:52:33 -03:00
Carlos Antonio da Silva
5d5636f03a Merge pull request #5369 from heartcombo/ca-lockable-reset-attempts
Create a model hook around the lockable warden hook to reset attempts
2021-04-02 15:52:43 -03:00
Carlos Antonio da Silva
a3ae35e9c9 Create a model hook around the lockable warden hook to reset attempts
Resetting failed attempts after sign in happened inside a warden hook
specific for the lockable module, but that was hidden inside the hook
implementation and didn't allow any user customization.

One such customization needed for example is to direct these updates to
a write DB when using a multi-DB setup. With the logic hidden in the
warden hook this wasn't possible, now that it's exposed in a model
method much like trackable, we can override the model method to wrap it
in a connection switch block for example, point to a write DB, and
simply call `super`.

Closes #5310
Related to #5264 and #5133
2021-04-02 15:45:25 -03:00
Carlos Antonio da Silva
e8e0c27599 Revert "Lock bundler to 2.2.9 instead of latest"
This reverts commit 1ba53dc369.

Let's give the latest bundler (2.2.15 as of today) a try again.
2021-03-30 21:53:57 -03:00
Carlos Antonio da Silva
429afcbe8a Bundle update 2021-03-30 21:53:56 -03:00
Carlos Antonio da Silva
ef9a2f4104 Use minitest helpers to check if objects respond to certain methods 2021-03-22 18:43:19 -03:00
Carlos Antonio da Silva
0cd72a56f9 Merge pull request #5347 from heartcombo/ca-build
Support Ruby 3+ officially, remove final Rails 6.1 deprecations, drop test dependency for XML serialization
2021-02-16 17:35:19 -03:00
Carlos Antonio da Silva
1ba53dc369 Lock bundler to 2.2.9 instead of latest
2.2.10 is causing the dependency resolution on Rails 6-0-stable to fail:

```
  Bundler could not find compatible versions for gem "railties":
    In Gemfile-rails-6-0:
      devise was resolved to 4.7.3, which depends on
        railties (>= 4.1.0)

      rails was resolved to 6.0.3.5, which depends on
        railties (= 6.0.3.5)

      responders (~> 3.0) was resolved to 3.0.1, which depends on
        railties (>= 5.0)
  Took  27.49 seconds
```

https://github.com/heartcombo/devise/runs/1905780158?check_suite_focus=true#step:5:23

The `railties` version 6.0.3.5 should work, given the other two are
using >= declarations, but it fails in 2.2.10.

Downgrading to 2.2.9 works.
2021-02-15 16:33:14 -03:00
Carlos Antonio da Silva
faef12cf2b Use the 6-0-stable version of Rails to fix issue with JSON responses
The test suite was failing on Rails 6.0 + Ruby 3 with errors like:

    Expected "{\"errors\":\"#<ActiveModel::Errors:0x000055f2e6cb8188>\"}"
    to include "{\"errors\":{".

The ActiveModel::Errors object wasn't being serialized to JSON as
expected, and this only happened with that combination of Ruby/Rails.

Upon further investigation, this was caused by a change in Ruby and
fixed in Rails in this PR: https://github.com/rails/rails/pull/39697
(which describes in more details the exact same problem and links to the
Ruby bug tracker with more information).

That fix was backported to 6-0-stable in June 2020, but hasn't been
officially released in a stable version yet: (there have been only
security fixes since then for 6.0)
75f6539d0e

Since the branch contains the fix, I'm pointing directly to it to get
the tests passing. We can't tell if there'll be a new stable 6.0 release
at this point, but hopefully yes, in which case we can go back at
pointing to it.
2021-02-15 16:33:03 -03:00
Carlos Antonio da Silva
c82a381f29 Bundle update 2021-02-15 14:45:04 -03:00
Carlos Antonio da Silva
a793472a3e Replace XML with JSON serialization across the test suite
This allows us to remove the dependency on the XML serializer provided
by the external `activemodel-serializers-xml` gem, and eliminates the
following deprecation warning:

    DEPRECATION WARNING: ActiveModel::Errors#to_xml is deprecated and
    will be removed in Rails 6.2.

Please note: this does not mean Devise doesn't support XML, it simply
means our test suite will use JSON to test non-navigatable formats
instead of XML, for simplicity. Devise's job is not to test object
serialization, so as long as your objects properly serialize to
XML/JSON/any other format, it should work out of the box.
2021-02-15 14:40:05 -03:00
Carlos Antonio da Silva
ad91686b62 Test on Ruby 3+ with Rails 6+
And remove dupe entry in the exclude matrix.

In order to get Ruby 3 working we needed to install `rexml` as part of
the test dependencies, only done on the main Gemfile (Rails 6.1) and the
6.0 versions. (which are the only ones supported by Ruby 3.)

Devise itself doesn't require `rexml` as it does nothing with it, but a
dependency we use during tests seem to require it. I was able to track
it down to omniauth-openid -> rack-openid -> ruby-openid requiring it:

    13a88ad644/lib/openid/yadis/xrds.rb (L1)

So while we have tests using omniauth-openid, we'll need this require in
place as well. Ideally that upstream version of ruby-openid should have
it, but it seems that one isn't updated in a while.
2021-02-15 14:34:36 -03:00
Carlos Antonio da Silva
1bb5fcbbec Merge pull request #5339 from ghiculescu/rails-deprecation
Fix deprecation warning on Rails 6.1

Related changes in Rails:
https://github.com/rails/rails/pull/38256
https://github.com/rails/rails/pull/38536
2021-02-02 21:27:31 -03:00
Alex Ghiculescu
80423c8f01 Fix deprecation warning on Rails 6.1 2021-02-02 15:37:45 -07:00
Carlos Antonio da Silva
743b6937e2 Merge pull request #5327 from heartcombo/ca-omniauth-2
Improve OmniAuth version check to allow anything from 1.0 forward
2021-02-01 17:30:37 -03:00
Carlos Antonio da Silva
e16d60d0fe Expand the release notes with more info about the OmniAuth v2 upgrade
I'm sure more people will hit issues so I'm trying to add more guidance
here about how to upgrade... maybe that should be in its own wiki but
I'll keep it all in the changelog for now.
2021-02-01 12:01:24 -03:00
Carlos Antonio da Silva
9d16f33c7b Revert "Explicitly set OmniAuth to 1.x in the Gemfiles for now"
This reverts commit 628f2fb2be.

We should be run green on OmniAuth 2.x now.
2021-02-01 11:51:23 -03:00
Carlos Antonio da Silva
c9a0f896cc Merge branch 'master' into ca-omniauth-2 2021-02-01 11:50:38 -03:00
Carlos Antonio da Silva
aa8d89579a Merge pull request #5338 from heartcombo/ca-build
Move build to GitHub Actions
2021-02-01 11:49:36 -03:00
Carlos Antonio da Silva
210c62af38 Add changelog about moving to GitHub Actions 2021-02-01 11:44:42 -03:00
Carlos Antonio da Silva
3048fe0960 Prevent Bundler 2.x. with Rails 4.x versions 2021-02-01 10:10:26 -03:00
Carlos Antonio da Silva
628f2fb2be Explicitly set OmniAuth to 1.x in the Gemfiles for now
The build is breaking with 2.x (which is expected), so this is a step to
get it to green on GA.
2021-01-31 10:19:06 -03:00
Carlos Antonio da Silva
13ba27497b Use the latest 2.x patch version for each Ruby, remove ruby-head
ruby-head was always in allowed failures with travis anyway, and we
never really paid much attention to it, so let's just remove it entirely
for now.
2021-01-31 10:08:57 -03:00
Carlos Antonio da Silva
7386f419e3 Use latest bundler on Gemfile.lock
Bundler 1.x uses git instead of https by default and we don't have that
github source setting in the Gemfile, but this should work.
2021-01-31 10:05:03 -03:00
Carlos Antonio da Silva
e07932c181 Rename gemfiles to keep consistency 2021-01-31 09:54:47 -03:00
Carlos Antonio da Silva
d0eafe70dc Remove the lock gemfiles from the previous versions
Keep only the lock for the main Gemfile to keep Devise consistent with
the other heartcombo libs.
2021-01-31 09:51:20 -03:00
Carlos Antonio da Silva
7e6da424e2 Move from Travis to GitHub Actions 2021-01-29 16:59:14 -03:00
AsbahIshaq
81bf3ad8c1 changed support to supports (#5334)
Co-authored-by: Asbah Ishaq <asbahishaq>
2021-01-24 08:51:09 -03:00
Carlos Antonio da Silva
51c05a5b21 Add changelog entry for OmniAuth 2 support
And a note/warning about how it might break apps that don't update their
integration accordingly as OmniAuth now expects.
2021-01-22 09:28:05 -03:00
Carlos Antonio da Silva
1d138dd40c Simplify OmniAuth version check by trying to load the gem with the necessary version 2021-01-22 09:16:58 -03:00
Carlos Antonio da Silva
c43ae8cb47 Merge branch 'master' into ca-omniauth-2 2021-01-19 15:22:57 -03:00
Carlos Antonio da Silva
cd60c747cc Update to latest released omniauth* gems
omniauth-openid v2.0.1 was just released opening support for omniauth
v2, so we can bundle update everything from the released gems now.
2021-01-19 15:21:26 -03:00
Jordan Owens
837baaf2e1 Update omniauthable tests for OmniAuth 2.0 (#5331) 2021-01-19 15:19:55 -03:00
Carlos Antonio da Silva
e0395367e4 Merge pull request #5333 from ghiculescu/patch-1
Fix Rails default log level in Readme
2021-01-18 21:53:46 -03:00
Carlos Antonio da Silva
fb17e2755f Move Rails 6.1 to the main Gemfile instead of an extra one
We have the gemfiles/* to test other versions of Rails, but keep the
most recent one in the main Gemfile.
2021-01-18 21:52:07 -03:00
Alex Ghiculescu
f4462cd85e Fix Rails default log level
This changed in 229fd2a02f - the advice about changing your log level still stands though.
2021-01-18 16:51:23 -06:00
Carlos Antonio da Silva
8bb358cf80 Improve OmniAuth version check to allow anything from 1.0 forward
This should enable people to try OmniAuth 2 currently in pre-release.
2021-01-07 09:21:15 -03:00
Ryunosuke Sato
98fc5e8e39 Test on rails 6.1 (#5323)
* Make test for validation to be Rails 6.1 compatible

The `ActiveModel::Errors` has been changed in Rails 6.1.
https://github.com/rails/rails/pull/32313

* Add gemfile for Rails 6.1

* Add CI matrix for Rails 6.1
2021-01-04 20:17:58 -03:00
Carlos Antonio da Silva
dfbed22cee Merge pull request #5315 from bipashant/master
Add missing period to devise.registrations.updated_but_not_signed_in
2020-11-23 08:10:22 -03:00
Bibek Sharma Chapagain
fd03f9e353 Added missing full stop "." on registrations.updated_but_not_signed_in. 2020-11-23 12:21:22 +11:00
Carlos Antonio da Silva
a19e78cdb4 Merge pull request #5306 from janz93/cleanup
Add to-do to cleanup rack/rails session bug fix when supporting Rails 5.2+ only
2020-11-22 21:42:48 -03:00
Jan Zaydowicz
b88af5d65e chore: add expiry note for old rack/rails session bug fix
Seven year ago rails `session.keys` could be empty if the session was
not loaded yet.

To prevent an error the removed code was introduced
https://github.com/heartcombo/devise/issues/2660

Since then rails changed the behaviour and makes sure that the session
is loaded before someone wants to access any session keys
3498aacbbe

Which means the `session.empty?` is not needed anymore once Rails 5.2+
and upwards only supported.
2020-11-22 12:33:30 +01:00
Carlos Antonio da Silva
45b831c4ea Release 4.7.3 2020-09-20 21:24:01 -03:00
Carlos Antonio da Silva
f12be553cc Update changelog [ci skip] 2020-09-20 10:45:10 -03:00
Carlos Antonio da Silva
4896a9b41a Update bundle 2020-09-20 10:43:42 -03:00
mune
eed641d2be Add spaces around method arguments when setting default values
Closes #5288
2020-08-31 18:15:45 -03:00
Carlos Antonio da Silva
97aa37bb50 Use assert_empty minitest helper 2020-08-27 18:40:03 -03:00
Carlos Antonio da Silva
15135f7dc6 User assert_includes/refute_includes minitest helpers 2020-08-27 18:38:26 -03:00
Carlos Antonio da Silva
e39b9b9134 Fix order of arguments for assert_equal on tests
Use `assert_equal expected, actual` for proper error messages in case of
failures.
2020-08-27 18:24:17 -03:00
Carlos Antonio da Silva
4a5e7a9143 Switch to https for git repos in the lock file 2020-08-27 08:54:18 -03:00
Carlos Antonio da Silva
8664bac682 Merge pull request #5286 from clockspring/fix-5285
Fix hanging tests for streaming controllers using Devise
2020-08-27 08:52:17 -03:00
Tony Novak
3e588d2d25 Work around "uncaught throw :warden" issue in Rails 4 2020-08-26 12:02:11 -04:00
Tony Novak
23fbc35b2d Fix hanging tests for streaming controllers using Devise
Fixes #5285.
2020-08-26 12:02:09 -04:00
Carlos Antonio da Silva
2c844b0649 Merge branch 'ca-deprecate-blacklist-constant' into master
Closes #5280
2020-08-20 09:07:43 -03:00
Carlos Antonio da Silva
0c2cab7c94 Deprecate BLACKLIST_FOR_SERIALIZATION on all supported Rails versions
Deprecate `BLACKLIST_FOR_SERIALIZATION` constant in favor of a more
descriptive name `UNSAFE_ATTRIBUTES_FOR_SERIALIZATION`, removing
unnecessary usage of the word `blacklist` from devise.

The previous constant still works but will emit a warning if used, to
allow anyone still depending on it to upgrade.

This includes an internal backport of the Rails `deprecate_constant`
implementation that exists on Rails 5.1+ to be able to deprecate it
properly in prior versions, while we support those. (which I intend to
drop soon.)
2020-08-19 19:36:25 -03:00
Seiei Miyagi
2da46d8dd6 Replace BLACKLIST_FOR_SERIALIZATION with DENYLIST_FOR_SERIALIZATION 2020-08-17 22:17:06 +09:00
Daniel Pepper
507573994a Ensure serializable_hash doesn't raise with a frozen :except array
I ran into an issue where options[:except] is a frozen array, which
explodes when we try to concat values in `serializable_hash`. To fix this
we dup the `:except` option before concatenating with the other options
there.

Closes #5278.
2020-08-13 18:38:23 -03:00
Carlos Antonio da Silva
f26e05c200 Update bundle 2020-08-10 22:47:15 -03:00
Carlos Antonio da Silva
f5cc775a5f Remove commented out code 2020-06-23 08:50:20 -03:00
Carlos Antonio da Silva
b94b957490 Prefer american style english for code
Nothing personal, just seems to be much more common usage across the
code.
2020-06-23 08:50:20 -03:00
Carlos Antonio da Silva
057afdc1e6 Fix another thor deprecation warning in the install generator
This one has been showing up when running tests:

    Deprecation warning: Expected string default value for '--orm'; got false (boolean).
    This will be rejected in the future unless you explicitly pass the options
    `check_default_type: false` or call `allow_incompatible_default_type!` in your code
    You can silence deprecations warning by setting the environment variable THOR_SILENCE_DEPRECATION.
2020-06-18 18:02:43 -03:00
Carlos Antonio da Silva
c249ba991b Merge pull request #5258 from deivid-rodriguez/fix_thor_warning
The `:orm` option can also have string values. Fixes #5252.
2020-06-18 18:00:11 -03:00
David Rodríguez
ffa8a80f42 Fix warning from thor
The `:orm` option can also have string values.
2020-06-18 16:21:58 +02:00
Carlos Antonio da Silva
4f60544396 Improve deprecation message with example of how to remove it
The deprecation of `devise_error_messages!` wasn't super clear on what
was happening and how to get rid of the message, not it has a more
detailed explanation with an example of what to look for and what to
replace it with.

Closes #5257.
2020-06-17 08:52:43 -03:00
Rafael França
79d7eddfc3 Merge pull request #5256 from ptcodes/remove_heroku_anchor_link
Remove Heroku anchor link and fix some typos
2020-06-15 23:38:36 -04:00
Pavel Timofeev
b25492ea01 Remove Heroku anchor link and fix some typos 2020-06-15 23:19:31 -04:00
Руслан Корнев
0e33f55b7d Fixes broken image (#5253) [ci skip] 2020-06-12 21:37:02 -03:00
Carlos Antonio da Silva
6991ff4eb4 Oops, fix changelog [ci skip] 2020-06-10 15:28:31 -03:00
Carlos Antonio da Silva
16f27b3074 Bump to v4.7.2 2020-06-10 15:23:45 -03:00
Carlos Antonio da Silva
87108ad4d5 Merge pull request #5250 from hyuraku/remove_useless_rails51
remove unused rails51? method
2020-06-09 10:18:55 -03:00
hyuraku
6d37e32437 remove useless rails51? method 2020-06-09 21:50:30 +09:00
Carlos Antonio da Silva
a3c0c65269 Devise no longer supports Rails 3.2 since version 4 [ci skip]
And this `initialize_on_precompile` option is obsolete.
2020-06-08 18:44:21 -03:00
Carlos Antonio da Silva
2c1b5fb240 Update changelog with latest [ci skip] 2020-06-08 18:40:50 -03:00
Carlos Antonio da Silva
50f820a6cf Use master of Rails controller testing gem to remove Ruby 2.7 warning 2020-06-07 20:00:17 -03:00
Carlos Antonio da Silva
34d9053819 Remove unnecessary monkey-patch of test helpers with Rails 5+
This is warning on Ruby 2.7, and seems unnecessary since Rails 5+
adopted kwargs approach. We still need to handle the difference for
Rails < 5 for now, while we support it (which I would like to remove
soon.)
2020-06-07 20:00:17 -03:00
Carlos Antonio da Silva
94be5fb6a1 Remove mocha deprecation warning
Mocha deprecation warning at
    ...../active_support/dependencies.rb:324:in `require':
    Require 'mocha/test_unit', 'mocha/minitest' or 'mocha/api'
    instead of 'mocha/setup'.
2020-06-07 19:49:51 -03:00
Carlos Antonio da Silva
14a3084b59 Simplify the view generator with scoped views 2020-06-07 19:16:36 -03:00
Carlos Antonio da Silva
bbbff3a350 Add changelog entry for #5067 [ci skip] 2020-06-07 19:16:36 -03:00
Carlos Antonio da Silva
a451b98cf2 Revert "Updated README with additional video resources for learning Devise (#5232)"
This reverts commit d85d45bcef.

My mistake: this section is about *not* using Devise when starting with
Rails and building authentication for the first time, therefore we
should not be linking to Devise specific resources here.

[ci skip]
2020-06-05 17:49:32 -03:00
Carlos Antonio da Silva
c3759be33e Link to both Ryan Bates Railscasts [ci skip] 2020-06-05 17:47:05 -03:00
David Kimura
d85d45bcef Updated README with additional video resources for learning Devise (#5232)
[ci skip]
2020-06-05 17:44:37 -03:00
David Auza
cb8c72171f Update README.md with current link to Railscast (#5221)
Updated README.md with the latest link to Ryan Bates' Railscast
2020-06-05 17:43:56 -03:00
Vitalii Lazebnyi
e0b9915418 #5234 fix. Deprecated warning at controller_helpers.rb 2020-06-05 11:41:19 -03:00
Carlos Antonio da Silva
26c7dffe2a Remove test_after_commit from Rails 5+ Gemfiles
It is not required anymore since Rails does the right thing since Rails
5.0.
2020-06-05 11:41:19 -03:00
Carlos Antonio da Silva
22e2ab4be3 Update Gemfile to point to Rails 6.0.x
This is essentially the same as `gemfiles/Gemfile.rails-6.0-stable`, but
I'm keeping both for now since I want to change the main `Gemfile` later
to point to Rails master (`6.1.0.alpha`), so then I won't need to
recreate the `6.0-stable` Gemfile again.
2020-06-05 11:40:57 -03:00
Carlos Antonio da Silva
a3d9161712 Bundle update everything 2020-06-05 11:13:22 -03:00
Carlos Antonio da Silva
2e3b70ca62 Update Ruby versions to test against 2020-06-05 11:13:22 -03:00
Carlos Antonio da Silva
1a83b58d72 Remove Rails 6 from allow failures
Rails 6 is officially supported, so tests must pass with it.
2020-06-05 11:13:22 -03:00
Carlos Antonio da Silva
e3f4beced4 Add Rails 5.1 to the matrix
Not sure how/when this one was removed, probably just mistakenly, so
let's add it back for now, at least while we support multiple old Ruby /
Rails versions. (which I plan to remove support in the near future.)
2020-06-05 11:13:21 -03:00
Carlos Antonio da Silva
9437f2de57 Test with Ruby 2.7 2020-06-05 10:25:08 -03:00
Carlos Antonio da Silva
70f3ae24e0 Merge pull request #5229 from okuramasafumi/patch-1
Correct warden URL in README [ci skip]
2020-05-01 08:20:35 -03:00
OKURA Masafumi
64ea43f6ab Correct warden URL in README [ci skip]
Warden moved to its own organization so we should follow it.
2020-05-01 16:48:17 +09:00
Carlos Antonio da Silva
a59fd76da4 Merge pull request #5225 from chiastolite/remove_unused_method
Remove unused method from Devise::Generators::InstallGenerator
2020-04-26 14:37:20 -03:00
Hiroyuki Morita
1f30f6fa85 Remove unused method from Devise::Generators::InstallGenerator
`rails_4?` is not called anymore since 2024fca4df.
2020-04-23 08:19:21 +09:00
Rafael França
6486351350 Merge pull request #5215 from HLFH/master
Fix Deprecation warning: Expected string default value for '--orm'
2020-04-16 14:41:55 -04:00
HLFH
d65bb156c1 type: :boolean for :orm 2020-03-28 09:13:35 +00:00
Gaspard d'Hautefeuille
6851f1d1c4 Deprecation warning: Expected string default value for '--orm' 2020-03-26 17:13:51 +00:00
Rafael França
769506e96c Merge pull request #5204 from unleashy/patch-1
Clarify DatabaseAuthenticable's behaviour for password fields
2020-03-12 14:54:45 -04:00
unleashy
eefae83c92 Make a more accurate claim 2020-03-12 15:52:51 -03:00
Rafael França
ec0b55a13a Merge pull request #5208 from p8/document-changes-stretches
Explain how changing stretches affects existing password hashes
2020-03-12 11:33:25 -04:00
Petrik
63fe1a843f Explain how changing stretches affects existing password hashes 2020-03-12 16:16:55 +01:00
unleashy
748803cd59 Clarify DatabaseAuthenticable's behaviour
with regards to the `password` field
2020-03-05 14:47:43 -03:00
Carlos Antonio da Silva
97a6fd2895 Merge pull request #5193 from pickerflicker/skip-timeout-optimization
Avoid checking if the record timed out when skipping timeoutable
2020-03-01 18:04:19 -03:00
Steven Hsieh
12a265d1eb optimize earlier timeout_skip to avoid unecessary record lookup 2020-02-19 10:51:36 -08:00
Rafael França
29943a26e6 Merge pull request #5192 from fwolfst/update_readme_rails6
update README to reflect current Rails version
2020-02-06 12:53:06 -05:00
Felix Wolfsteller
249064d8f6 update README to reflect current Rails version
Paragraph defaults to description of how to test in Rails 5/6 now.
2020-02-06 18:13:30 +01:00
Rafael Mendonça França
f8daa52b9b Change license of the logo 2020-02-03 12:01:11 -05:00
Rafael Mendonça França
a17abad57a Remove all references to Plataformatec 2020-02-03 11:33:17 -05:00
Rafael França
3ef4e0b701 Merge pull request #5172 from lukerollans/chore/case-mapping-collisions-test
Add a test which checks for Case Mapping Collisions when requesting a password reset
2020-01-22 12:23:22 -05:00
Rafael França
83a32e6d21 Merge pull request #5174 from connorshea/fix-ruby-27-deprecation-warnings
Fix two deprecated usages of keyword arguments.
2019-12-27 12:44:32 -03:00
Connor Shea
a3fcb3b682 Fix two deprecated usages of keyword arguments.
This prevents us from using behavior that was deprecated in Ruby 2.7.
2019-12-26 17:44:53 -07:00
Luke Rollans
0d95c5ae8b Generalise email address 2019-12-17 13:47:40 +08:00
Luke Rollans
9fb079c097 Add a test which checks for Case Mapping Collisions when resetting pw
See here for more information
https://eng.getwisdom.io/hacking-github-with-unicode-dotless-i/
2019-12-17 13:43:53 +08:00
Leonardo Tegon
43068ac239 Merge pull request #5167 from plataformatec/sp-fix-typos
Fix typos
2019-11-29 09:53:03 -03:00
Samuel Pordeus
fb18c6ca8d Fix typos 2019-11-28 18:13:47 -03:00
Colin Ross
14863ba4c9 Documentation: Details/Notes regarding Rails API-only applications (#5152)
* doc: Add some additional details concerning using devise in an API-only Rails application

* Apply wording suggestions from code review

Co-Authored-By: Marcos Ferreira <mracos@users.noreply.github.com>

* Apply suggestions from code review

Co-Authored-By: Marcos Ferreira <mracos@users.noreply.github.com>
2019-10-29 15:06:37 -03:00
Rafael França
885c61ece3 Merge pull request #5157 from tabakazu/add_assert_and_replace_mathcer
Add assert to Lockable integration test and Replace mathcer `assert_not` to `refute`
2019-10-25 11:54:53 -04:00
tabakazu
940b939791 Add assert for check last_sign_in_ip value 2019-10-24 21:12:27 +09:00
Looi David
406915cb78 changed? behaviour has been updated (#5135)
* `changed?` behaviour has been updated

Due to 16ae3db5a5 `changed?` has been updated to check for dirtiness after save. The new method that behaves like the old `changed` is `saved_changes?`.

* Add comment to explain which method to used based on which rails version it is
2019-10-22 10:39:34 -03:00
Leonardo Tegon
c5de662454 Merge pull request #5153 from storrence88/patch-1
Update README.md
2019-10-14 14:21:00 -03:00
Steven Torrence
0a6cd99d03 Update README.md
Change before filter to before action to match the code example given below.
2019-10-11 09:27:46 -05:00
Leonardo Tegon
ffeb942699 Merge pull request #5148 from gurgelrenan/flash_message
Call set_flash_message helper instead of flash accessor
2019-10-07 15:35:00 -03:00
Leonardo Tegon
f148c90fc7 Merge pull request #5142 from rlue/doc/initializer
Explain layout of default config initializer
2019-10-07 15:02:24 -03:00
Renan Gurgel
d022fb8cc4 Update code with single-quotes 2019-10-03 14:27:59 -03:00
Renan Gurgel
421ffc479f Add test to admin error message 2019-10-03 14:15:47 -03:00
Renan Gurgel
0f134f7030 Call set_flash_message helper instead of flash accessor 2019-10-03 00:15:15 -03:00
Ryan Lue
5d73e1e3bb Explain layout of default config initializer [ci skip] 2019-09-27 06:21:27 +08:00
Marcos Ferreira
f48b6f1651 Merge pull request #5067 from shobhitic/master
Using scoped errors for scoped views. Fixes #5066
2019-09-17 14:49:57 -03:00
Marcos Ferreira
34ed989725 Move PR #5074 to unreleased in changelog [skip ci] 2019-09-17 13:38:00 -03:00
Marcos Ferreira
b52e642c01 Merge pull request #5074 from sergey-alekseev/increase-default-stretches-to-12
Increase default stretches to 12
2019-09-17 13:30:55 -03:00
Leonardo Tegon
098345aace Prepare for version 4.7.1 2019-09-06 10:20:20 -03:00
Leonardo Tegon
caa1a55d17 Update CHANGELOG.md [ci skip] 2019-09-05 09:55:12 -03:00
Leonardo Tegon
fee43f3c11 Always return an error when confirmation_token is blank (#5132)
As reported in https://github.com/plataformatec/devise/issues/5071, if
for some reason, a user in the database had the `confirmation_token`
column as a blank string, Devise would confirm that user after receiving
a request with a blank `confirmation_token` parameter.
After this commit, a request sending a blank `confirmation_token`
parameter will receive a validation error.
For applications that have users with a blank `confirmation_token` in
the database, it's recommended to manually regenerate or to nullify
them.
2019-09-04 15:42:48 -03:00
Leonardo Tegon
fad60747d5 Merge pull request #5125 from olleolleolle/patch-1
CI: Drop unused Travis sudo: false directive
2019-08-30 19:30:03 -03:00
Leonardo Tegon
5ceef2d4de Merge pull request #5131 from lslm/ls-fix-typo
Fix typo in email update message
2019-08-30 17:26:22 -03:00
Lucas Santos
6635caf12e Fix typo 2019-08-30 14:35:19 -03:00
Olle Jonsson
e051360ea2 CI: Drop unused Travis sudo: false directive 2019-08-26 13:36:34 +02:00
Leonardo Tegon
6bb74c5abf Update CHANGELOG.md [ci skip] 2019-08-19 13:32:56 -03:00
Leonardo Tegon
a79057070c Prepare for 4.7.0 release 2019-08-19 11:35:55 -03:00
Ewerton
12fc5b76d8 Update README.md (#5115) 2019-08-15 09:28:15 -03:00
Leonardo Tegon
ad5892391d Fix specs on Rails 6 RC2 (#5109)
* Fix specs on Rails 6 RC2

`ActiveRecord::MigrationContext` now has a `schema_migration` attribute.
Ref: https://github.com/rails/rails/pull/36439/files#diff-8d3c44120f7b67ff79e2fbe6a40d0ad6R1018

* Use `media_type` instead of `content_type`

Before Rails 6 RC2, the `ActionDispatch::Response#content_type` method
would return only the media part of the `Content-Type` header, without any
other parts. Now the `#content_type` method returns the entire header -
as it is - and `#media_type` should be used instead to get the previous
behavior.

Ref:
- https://github.com/rails/rails/pull/36034
- https://github.com/rails/rails/pull/36854

* Use render template instead of render file

Render file will need the full path in order to avoid security breaches.
In this particular case, there's no need to use render file, it's ok to
use render template.

Ref: https://github.com/rails/rails/pull/35688

* Don't set `represent_boolean_as_integer` on Rails 6

* Update comments [ci skip]
2019-08-07 12:32:01 -03:00
Leonardo Tegon
df43a3560a Rails 6 release candidate 2 on CI 2019-08-05 14:29:21 -03:00
Rafael França
9aa17eec07 Merge pull request #5099 from efojs/patch-1
Update Options section of comment in routes.rb
2019-07-16 02:43:34 +01:00
Denis Krasulin
45cc668683 Update routes.rb
Comment incorrectly states that default method is "get", while line 228 of /lib/devise.rb sets "delete": "The default method used while signing out: @@sign_out_via = :delete"
2019-07-16 01:08:44 +03:00
Vasiliy Ermolovich
19045a483d Merge pull request #5089 from abhijeetps/abhijeetps-patch-1
Updated Codeacademy's Rails Auth link
2019-07-02 10:11:33 +03:00
Abhijeet Singh
f618b88f91 Updated Codeacademy's Rails Auth link 2019-06-26 15:22:40 +05:30
Rafael França
81cb5b00f4 Merge pull request #5086 from plataformatec/rm-officially-support-6.0
Officially support Rails 6.0
2019-06-18 13:49:34 -04:00
Rafael Mendonça França
54fb582269 Officially support Rails 6.0
Also remove upper bound on railties so people can try devise with new
versions without having to wait us to change the gem and report bugs.
2019-06-12 16:10:13 -04:00
Rafael Mendonça França
44f7325a91 Remove unneeded require
The code that was using that constant is not being used anymore.

Closes #5083
2019-06-12 16:04:50 -04:00
Marcos Ferreira
4ab54943ad Merge pull request #5073 from plataformatec/mf-use-rails-6-rc-1-on-ci
Use rails 6.0.0.rc1 instead of the 6.0.0.beta-3 on CI
2019-05-14 13:27:28 -03:00
Sergey Alekseev
45245df16a update changelog
[skip ci]
2019-05-13 14:15:14 +03:00
Sergey Alekseev
63ea6533de increase default stretches to 12
Test script
---

```ruby
require 'bcrypt'
require 'benchmark'
Benchmark.measure { BCrypt::Password.create('password', cost: 12) }
```

Test results
---

- [Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz](https://ark.intel.com/content/www/us/en/ark/products/97535/intel-core-i5-7360u-processor-4m-cache-up-to-3-60-ghz.html): `#<Benchmark::Tms:0x00007fdd00a4eb30 @label="", @real=0.21730700000080105, @cstime=0.0, @cutime=0.0, @stime=0.00020399999999999585, @utime=0.21685199999999996, @total=0.21705599999999997>`
- [Intel(R) Core(TM) i7-8559U CPU @ 2.70GHz](https://ark.intel.com/content/www/us/en/ark/products/137979/intel-core-i7-8559u-processor-8m-cache-up-to-4-50-ghz.html): `#<Benchmark::Tms:0x00007fe91094fd30 @label="", @real=0.17964200000278652, @cstime=0.0, @cutime=0.0, @stime=7.399999999996298e-05, @utime=0.17950799999999845, @total=0.1795819999999984>`

Other gems
---

- bcrypt-ruby which is used by devise [updated](https://github.com/codahale/bcrypt-ruby/pull/181) their default cost to 12 (not released a gem version yet).
- rails has [a PR](https://github.com/rails/rails/pull/35321) from the Rails core team member to update their `ActiveModel::SecurePassword` which powers `has_secure_password` default cost to 13 (not merged yet).

Previous changes
---

[Previous PR](https://github.com/plataformatec/devise/pull/3549) to increase the default stretches to 12 was created more than 4 years ago. That time the default stretches value [was increased](9efc601c73) from 10 to 11.
2019-05-11 19:35:13 +03:00
Marcos Ferreira
aedc9b7696 Update CHANGELOG.md [ci skip] 2019-05-06 21:10:27 -03:00
Marcos Ferreira
28248e3167 Merge pull request #5069 from igorkasyanchuk/master
Fix rails_51_and_up? method for Rails 6.rc1
2019-05-06 21:03:16 -03:00
Igor Kasyanchuk
612e30258c Use better syntax to compare gem version 2019-05-05 03:44:44 -07:00
Marcos Ferreira
76c888268b Use rails 6.0.0.rc1 instead of the 6.0.0.beta-3 on CI
Also bumped sqlite from 1.3.6 to 1.4 because besides conflicting with
the version that the sqlite adapter was trying to load [0], it is supported
officially since rails 6 [1].

Related:
[0] rails/rails#35153
[1] rails/rails#35844
2019-05-04 15:43:31 -03:00
Marcos Ferreira
07f2712a22 Merge pull request #5065 from Vasfed/fix/rails6_deprecation_email_validation
Fix rails 6.0.rc1 email uniqueness validation deprecation error
2019-05-04 14:41:25 -03:00
Igor Kasyanchuk
75e8555035 Fix rails_51_and_up? method for Rails 6.rc1 2019-05-03 13:11:34 -07:00
Shobhit Bakliwal
a823e510f3 Using scoped errors for scoped views. Fixes #5066 2019-05-02 13:24:01 +05:30
Vasily Fedoseyev
2d53cf4424 Fix rails 6.0.rc1 email uniqueness validation deprecation error 2019-04-26 14:20:30 +03:00
Felipe Renan
e91b8ee0ba Merge pull request #5055 from saiqulhaq/master
refactor method name to be more consistent
2019-04-05 10:03:37 -03:00
Leonardo Tegon
eced9b015b Merge pull request #5057 from plataformatec/af-update-ci-with-rails-6
Update CI to rails 6.0.0.beta3
2019-04-04 15:40:07 -03:00
Ayrton Felipe
dbc3c4f08f Update CI to rails 6.0.0.beta3
In order to check CI behavior was requested by @tegon in slack
channel to update rails 6.0.0.beta1 to 6.0.0.beta3

Issue reference: 5037
2019-04-04 11:40:03 -03:00
M. Saiqul Haq
0d56ae2705 refactor method name to be more consistent 2019-04-04 07:01:39 +07:00
Lucas Ferreira
c1e4031e3b Merge pull request #5054 from ferrl/update-autocomplete
Update password confirmation autocomplete
2019-04-03 11:16:45 -03:00
Lucas Ferreira
964ae53e5b Update password confirmation autocomplete 2019-04-02 18:39:19 -03:00
Leonardo Tegon
2e5b5fcd70 Prepare for 4.6.2 release 2019-03-26 13:26:56 -03:00
Leonardo Tegon
241e8077e3 Update CHANGELOG.md [ci skip] 2019-03-26 13:23:20 -03:00
Leonardo Tegon
55e726e4a7 Merge pull request #5051 from plataformatec/mf-revert-update-encrypted-password-to-nil-if-password-is-nil
Reverts both "[#4245] Allow password to nil (#4261)" and "Add more tests (#4970)"
2019-03-26 11:37:27 -03:00
Marcos Ferreira
f9d13f015a Revert "[#4245] Allowing password to nil (#4261)"
This reverts commit 3aedbf0a4d.
2019-03-26 10:29:46 -03:00
Marcos Ferreira
e704221842 Revert "Add more tests (#4970)"
This reverts commit 05bf574799.
2019-03-26 10:29:16 -03:00
Leonardo Tegon
2a6d608bd8 Merge pull request #5050 from softwaregravy/patch-1
Fix dead link
2019-03-25 18:02:20 -03:00
John Hinnegan
b2dc388556 Fix dead link
The link that's in there goes to a non-existent page. I'm guessing it was moved. I put the link in that I think it was moved to.
2019-03-24 11:07:29 -04:00
Marcos Ferreira
214ce91bf7 Merge pull request #5045 from matheusbn/small-text-fix-in-strategies/authenticatable.rb [skip ci]
Fix RDoc text redundancy in authenticatable.rb strategy
2019-03-18 09:40:53 -03:00
Matheus Berkenbrock Nedel
a460d79b08 fix text redundancy 2019-03-17 21:20:06 -03:00
emersonthis
2f3a59640b Added mention of API mode complications to README (#5041) [ci skip] 2019-03-14 18:19:45 -03:00
Felipe Renan
1102600720 Force nokogiri 1.9.1 on Rails 4.1
Sometimes our CI breaks because it tries to fetch a higher nokogiri
version that requires Ruby 2.3+.
2019-03-03 20:48:40 -03:00
Leonardo Tegon
4e4e42e1ae Include note about security issues in ISSUE_TEMPLATE.md 2019-02-19 16:04:32 -03:00
Leonardo Tegon
20e299bce0 Prepare for 4.6.1 release 2019-02-11 11:38:35 -02:00
Leonardo Tegon
5be5220e5a Update CHANGELOG.md [ci skip] 2019-02-11 11:04:12 -02:00
Leonardo Tegon
fcb04f5302 Check if root_path is defined with #respond_to? instead of #present (#5022)
When an application does not define a `root`, the method will be
undefined instead of returning a falsey value.
This commit also includes a new test with fake objects that mimic this
behavior.

Related resources:

* 1aab449933 (diff-c1be825bdb5f3160081e41432f83d0d7R278)
* https://github.com/plataformatec/devise/issues/5021
2019-02-11 11:00:56 -02:00
Leonardo Tegon
45016829d6 Prepare for 4.6.0 release
It was necessary to manually set the `sqlite3` Gem version after the
release of version `1.4.0`.
See https://github.com/rails/rails/issues/35153 for more info.
2019-02-07 13:28:00 -02:00
Leonardo Tegon
337db5a3a2 Update CHANGELOG.md [ci skip] 2019-02-06 20:01:55 -02:00
Felipe Renan
a921c10e6a Merge pull request #5018 from plataformatec/frg-fix-webrat-warning
Fix webrat warnings
2019-02-04 15:54:36 -02:00
Felipe Renan
101e50f9df Fix webrat warnings
Forwarding methods to private methods is deprecated and produces a
warning after Ruby 2.4.

see: https://bugs.ruby-lang.org/issues/12782

To fix this issue I'm mocking patching webrat making RailsAdatper#response
method public since Webrat::Session is delegating functions to it.
2019-02-04 14:50:14 -02:00
Felipe Renan
6064ca8b73 Merge pull request #5014 from plataformatec/frg-fix-test-setup
Fix bin/test using Rails::TestUnit
2019-01-30 19:00:18 -02:00
Felipe Renan
2dd322579f Fix bin/test to use Rails::TestUnit
The command bin/test stop running single tests once Devise started to
support Rails 5.2. The problem is because we used `rails/test_unit/minitest_plugin`
and this file was moved to another place.

See: https://github.com/rails/rails/pull/29572

I'm not sure if we should require the `minitest-plugin` directly from
Rails like we were doing, I tried it and it didn't work. So I'm
changing this `bin/test` completely based on how Rails does that [here](https://github.com/rails/rails/blob/master/tools/test.rb)
2019-01-29 17:50:50 -02:00
Felipe Renan
e72839f4bc Merge pull request #5011 from plataformatec/frg-fix-sqlite-warning
Fix SQLite3 warning when running tests
2019-01-28 15:29:25 -02:00
Felipe Renan
45438fcfc4 Fix SQLite3 warning
Before setting this option, our test suite was giving the following warning:

```
DEPRECATION WARNING: Leaving `ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer`
set to false is deprecated. SQLite databases have used 't' and 'f' to serialize
boolean values and must have old data converted to 1 and 0 (its native boolean
serialization) before setting this flag to true. Conversion can be accomplished
by setting up a rake task which runs

  ExampleModel.where("boolean_column = 't'").update_all(boolean_column: 1)
  ExampleModel.where("boolean_column = 'f'").update_all(boolean_column: 0)

for all models and all boolean columns, after which the flag must be set to
true by adding the following to your application.rb file:

  Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
 (called from <top (required)> at $PATH/devise/test/rails_app/app/active_record/user.rb:5)
```

After configuring `represent_boolean_as_integer = true` as specified
above, we don't have this warning anymore.

More info:
https://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/SQLite3Adapter.html#method-c-represent_boolean_as_integer
2019-01-28 14:39:06 -02:00
Felipe Renan
f3329110ba Update README to help run tests [ci skip] (#5012)
Adds a section to help contributors run Devise test suite.
2019-01-28 14:31:42 -02:00
Hyeonseok
369ba267ef removing white space in devise generator new.html.erb (#5010) 2019-01-24 10:20:03 -02:00
Felipe Renan
a42033cb04 Update CHANGELOG.md [ci skip] 2019-01-23 16:02:12 -02:00
Felipe Renan
1aab449933 Refactor fix #4127
* Adding to check if rootpath is present on url_helpers.
* Run this code only for Rails versions lower than 5.1.
2019-01-23 15:42:17 -02:00
Alessandro
ee65cd60c9 FIX plataformatec/devise#4127 (#4700) 2019-01-23 15:32:29 -02:00
Leonardo Tegon
c000b58c56 Add Rails 6 to CI (#5009) 2019-01-22 12:43:31 -02:00
Matthew Rudy Jacobs
40e8812d75 Apply Test Helper fix to Rails 6.0 as well as 5.x (#5002) 2019-01-17 18:29:00 -02:00
Felipe Renan
cc6046b8cc Merge pull request #5005 from plataformatec/frg-fix-travis-build
Fix travis build
2019-01-17 18:26:54 -02:00
Felipe Renan
6b1ead8654 Fix travis build
Now Travis uses bundler 2.0+ and it causes some build fails since we
still support Rails 4.

This commit set Travis to not use a bundler version higher than 2.0.

More info: https://docs.travis-ci.com/user/languages/ruby/#bundler-20
2019-01-17 17:45:12 -02:00
Patrick Jones
518f6f39bf Fixed broken README link in changelog [ci skip] (#4999) 2019-01-10 11:09:51 -02:00
Rafael França
6edbeb82cd Merge pull request #4998 from Atul9/update-license
Update copyright notice to 2019 [ci skip]
2019-01-07 14:23:26 -05:00
Atul Bhosale
a8d0a8f63d Update copyright notice to 2019 [ci skip] 2019-01-07 23:28:19 +05:30
Leonardo Tegon
62703943be Make #increment_failed_attempts concurrency safe (#4996)
As reported in #4981, the method `#increment_failed_attempts` of `Devise::Models::Lockable` was
not concurrency safe. The increment operation was being done in two steps: first the value was read from the database, and then incremented by 1. This may result in wrong values if two requests try to update the value concurrently. For example:

```
Browser1 -------> Read `failed_attempts` from DB (1) -------> Increment `failed_attempts` to 2
    Browser2 -------> Read `failed_attempts` from DB (1) -------> Increment `failed_attempts` to 2
```

In the example above, `failed_attempts` should have been set to 3, but it will be set to 2. 

This commit handles this case by calling `ActiveRecord::CounterCache.increment_counter` method, which will do both steps at once, reading the value straight from the database.

This commit also adds a `ActiveRecord::AttributeMethods::Dirty#reload` call to ensure that the application gets the updated value - i.e. that other request might have updated. 
Although this does not ensure that the value is in fact the most recent one - other request could've updated it after the `reload` call - it seems good enough for this implementation. 
Even if a request does not locks the account because it has a stale value, the next one - that updated that value - will do it. That's why we decided not to use a pessimistic lock here.

Closes #4981.
2018-12-28 17:00:50 -02:00
kenji kobayashi
e3a00b27d1 Add an option to not automatically sign in a user after changing a password (#4569) 2018-12-28 11:29:58 -02:00
Pavel Pestau
8266e85576 Removing extra characters (#4991) 2018-12-21 10:18:05 -02:00
Pavel Pestau
4372dd402b Removed extra characters (#4988) 2018-12-20 11:51:19 -02:00
Marcos Ferreira
6e4b0b94bc Don't run gem update --system and gem install bundler on CI
There were some issues with the combination of some `bundler` and `rubygems` versions.
We got around that by always updating `bundler` in the CI but since those issues
were fixed we can quit doing that.

Related to `gem update --system`:
- travis-ci/travis-ci#8978
- rubygems/rubygems#2123

Related to `gem install bundler`:
- travis-ci/travis-ci#9333
- travis-ci/travis-ci#8969
- bundler/bundler#6340
2018-12-19 17:04:56 -02:00
Leonardo Tegon
bf74a506c8 Update CHANGELOG.md [ci skip] 2018-12-19 10:32:50 -02:00
Marcos Ferreira
e01fb8bb22 Merge pull request #4989 from plataformatec/mf-fix-unclosed-tag-error-messages-partial
Fix unclosed html tag and add deprecation warn
2018-12-19 09:52:10 -02:00
Marcos Ferreira
14785afe8d Add a deprecation warn for DeviseHelper.devise_error_messages!
To customize the error style one should modifying the
`devise/shared/error_messages` partial.
2018-12-18 21:15:13 -02:00
Marcos Ferreira
66a96ab9d6 Fix unclosed li tag in error_messages partial 2018-12-18 21:15:11 -02:00
Graham Brereton
76b87dc0e8 Refactor the devise_error_messages! helper to render a partial (#4616)
This should make it more intuitive and easier for developers using the
project to implement their own layout for errors.
2018-12-18 21:01:16 -02:00
Leonardo Tegon
cb663e96a3 Update CHANGELOG.md [ci skip] 2018-12-04 14:37:20 -02:00
Stan Hu
1192c76f62 Fix corner case when confirmation_sent_at is equal to 0.days.ago (#4529)
If `Confirmable#confirmation_sent_at` is equal to `0.days.ago`, then
`confirmation_period_valid?` will be deemed valid even if the setting is
configured to disable this outright. To prevent this error, we explicitly
check the configuration setting to be `0.days.ago`.
2018-12-04 14:34:32 -02:00
Leonardo Tegon
ecd2187652 Update CHANGELOG.md [ci skip] 2018-11-30 17:43:28 -02:00
ihatov08
d1571627b7 Add deprication waring if use options argument at DatabaseAuthenticatable#update_with_password,#update_without_password (#4935) 2018-11-28 17:58:10 -02:00
Leonardo Tegon
52b24e41de Fix typo [ci skip] 2018-11-23 13:26:26 -02:00
Leonardo Tegon
5f62f28d6e Explain the code that prevents enumeration attacks 2018-11-22 20:38:02 -02:00
Jason Lee
c84169122f Ignore useless files into the gem file. (#4955) 2018-11-22 20:04:53 -02:00
Kanmaniselvan Murugesan
bafc23eae5 Issue 4895: Add after_database_authentication callback after sign_in immediately after password update (#4916) 2018-11-22 19:13:55 -02:00
Leonardo Tegon
aa6cb411bc Add missing specs for #find_or_initialize_with_errors
After merging https://github.com/plataformatec/devise/pull/4797, I
noticed that we had no specs for the scenarios where this method was
adding the errors to the resource. This commit adds tests to cover those
cases.
2018-11-22 18:44:09 -02:00
Ryan Lue
354df3bc65 [bugfix] [refactoring] Sanitize parameters in find_or_initialize_with_errors (#4797)
* Use parameter sanitizer for new records in find_or_initialize_with_errors

* Add test for find_or_initialize_with_errors bugfix
2018-11-22 15:10:50 -02:00
Kopylov Vladislav
6f140faf0d fixed description for Devise::Generators::ControllersGenerator (#4975) 2018-11-21 19:20:23 -02:00
Leonardo Tegon
05bf574799 Add more tests (#4970)
After merging #4261, I realized that we could add a couple more
tests, to ensure the new behavior added to `#valid_password?` - which is
that it should return `false` when the password is either `nil` or blank
('').
I've also removed [this
condition](https://github.com/plataformatec/devise/blob/master/lib/devise/models/database_authenticatable.rb#L68)
because it's already present at `Devise::Encryptor` module in the
`.compare`
[method](https://github.com/plataformatec/devise/blob/master/lib/devise/encryptor.rb#L15).
2018-11-13 15:29:14 -02:00
Colin Ross
40f02ae69b Only flash if the request object that is loaded supports it (#4950) 2018-11-13 15:26:00 -02:00
sivagollapalli
3aedbf0a4d [#4245] Allowing password to nil (#4261)
* [#4245] Allowing password to nil

* Set encrypted password to nil if password is nil

* [#4245] Fixing the build

* Removed unnecessary code
2018-11-13 13:57:23 -02:00
John Gabriel
fa067b31c6 chore(docs): allow_unconfirmed_access_for = nil (#2275) (#4964) 2018-11-12 14:27:27 -02:00
Vasiliy Ermolovich
517010e2c5 Merge pull request #4961 from HarlemSquirrel/issue-template-20181028
Fix Issue template grammar
2018-10-28 21:01:28 +03:00
Vasiliy Ermolovich
4adc792422 Merge pull request #4960 from HarlemSquirrel/contributing-20181028
Fix CONTRIBUTING.md typo
2018-10-28 19:51:59 +03:00
Kevin McCormack
0640b318ca Fix Issue template grammar 2018-10-28 12:41:08 -04:00
Kevin McCormack
95fad8b408 Fix CONTRIBUTING.md typo 2018-10-28 12:36:00 -04:00
Sam Weerasinghe
94adec3cee Issue #4941 , handle error 'Please specify the Rails release the migration was written for' (#4942) 2018-10-03 15:21:59 -03:00
Ieva S
87b73540a4 Updated year in MIT-LICENSE (#4948) 2018-10-01 08:38:41 -03:00
Isaac Orme
25f908ad9c issue 4526 adds skip email and password change notifications methods (#4824) 2018-09-28 18:55:00 -03:00
Rafael França
4656e96d9e Merge pull request #4938 from colinross/issue-#4931-missing-comma
Missing comma in form input
2018-09-19 22:03:22 -04:00
Colin Ross
389cd85d47 Missing comma in form input 2018-09-19 18:19:56 -07:00
Leonardo Tegon
3b0bc08ec6 Prepare for 4.5.0 release 2018-08-15 20:03:08 -03:00
Leonardo Tegon
2eca92f950 Update CHANGELOG.md 2018-08-15 17:05:50 -03:00
Isaac Orme
acc45c5a44 issue 4356 adds is_navigational_format? check to after_sign_up_path_for (#4833) 2018-08-02 11:02:50 -03:00
Guillaume CABANEL
e4dd1509c4 Update README.md (#4911)
update links to rubydoc.info to the url `www.rubydoc.info` since the ssl certificate is only valid for www.rubydoc.info (not rubydoc.info)
2018-07-31 11:36:42 -03:00
Phil Nash
b8f644198d Corrects brakes -> breaks when talking about tests (#4897) 2018-07-03 09:52:07 -03:00
lucfranken
715192a770 Improve getting started text on Gemfile (#4875)
The original text: 

> You can add it to your Gemfile with:

Could easily be read as: "Run this command to add it to your Gemfile"

That's what I did at least. I think the change makes it much clearer that you need to really manually add a line of text into the Gemfile.

One of the reasons why this is not fully clear is that it's badly visible on Github whether a command is a console / terminal command or a ruby line of code. Visually they look the same except for the $ sign which is easy to overlook.
2018-05-16 14:48:24 -03:00
Josh Pencheon
31aceeb104 Fix bug: ParameterFilter should not add keys (#3431) (#4457)
If called with a hash that has a `default` / `default_proc`
configured, `Devise::ParameterFilter` can add in missing keys
it was due to attempt to sanitise the values for.

This patch prevents this from happening, whilst also clarifying
the filtering intent of `ParamaterFilter`.

(This can also occur if NilClass has been augmented with definitions
for `strip` or `downcase`.)

Fixes #3431.
2018-05-15 10:47:18 -03:00
Samy Kacimi
af8f7e9797 remove :trackable from the default modules (#4857)
This removes :trackable from the default modules in the generators,
to be more GDPR-friendly.
2018-05-14 18:11:15 -03:00
Gencer W. Genç
6c916488af find auto-generated secret_key_base in development (#4869)
With this fix, we will try latest changes in Rails 5.2 together with standard auto-generated secret_key_base in development as a fallback.

If no specified key found, auto-generated value will be used instead.
2018-05-14 18:09:25 -03:00
Maud de Vries
246a50876a Mention the -c flag for the controller generator
Similar to the views section, that mentions the -v flag
2018-05-11 10:20:23 -03:00
Andrey Andreev
8866b8e5eb Fix error when params is not a hash 2018-05-09 14:56:50 -03:00
Tony Correia
1c8e97c75a Issue 4763: Change login errors for when in paranoid mode 2018-05-09 10:49:27 -03:00
Gustavo Bazan
cd9ad848fb Update simple form templates
Update `simple_form` templates with changes from 16b3d6d67c and 6260c29a86
2018-05-08 15:42:26 -03:00
Vasiliy Ermolovich
be15116426 Merge pull request #4858 from lookageek/patch-1
Fix in rdoc of DeviseController#_prefixes
2018-05-03 13:12:38 +03:00
Jayanth Manklu
9d90a559ce Fix in rdoc of DeviseController#_prefixes
Removing an additional "is"
2018-05-03 15:36:43 +05:30
Rafael França
d98f38cf5f Merge pull request #4848 from abhishekkanojia/refactor_code
Remove redundant self from database_authenticatable module.
2018-04-23 12:08:42 -04:00
Abhishek kanojia
f99636da76 Remove redundant self from database_authenticatable module. 2018-04-22 11:57:18 +05:30
Gustavo Bazan
6260c29a86 Improve passwords autocomplete
Use `autocomplete="new-password"` or `autocomplete="current-password"` to better signal to browsers and password managers how to handle the password fields.

This feature is especially useful for “change your password” and “new user” forms
2018-04-19 12:58:58 -04:00
Rafael França
45481df14a Merge pull request #4843 from lancecarlson/master
upgrade dependencies for rails and responders
2018-04-18 13:55:41 -04:00
Lance Carlson
7eccd4e9c6 upgrade dependencies for rails and responders 2018-04-17 00:03:12 -04:00
yhirano55
2cf18f99e0 CI against Ruby 2.3.7, 2.4.4, 2.5.1 2018-04-07 00:21:12 -03:00
Leonardo Tegon
bcbea08187 Add note in the documentation about sign_in and timeoutable
In order to use the `sign_in` helper along with the timeoutable module,
we have to set `env["devise.skip_timeout"] = true` in the request.
Currently, we do this in the sessions controller: https://github.com/plataformatec/devise/blob/master/app/controllers/devise/sessions_controller.rb#L7
This commit adds a note to the `sign_in` documentation to help other
developers that want to use custom warden strategies.

Closes #4773
2018-04-04 21:00:49 -03:00
Max Kramer
b20de505ab Split IP resolution from update_tracked_fields
This permits users to easily customize where the ip address
should be resolved.  When fronting the application with a webserver or
load balancer, the ip address may be the server and not be the user.

E.g. consider the IP address is passed as the header: "X-Forwarded-For".

```ruby
class User
  devise :trackable

  protected
    def extract_ip_from(request)
      request.headers["X-Forwarded-For"]
    end
end
```
2018-04-03 09:53:28 -03:00
yusukemorita
20bde34981 added link to integration tests section 2018-03-30 10:57:12 -03:00
yusukemorita
e9abba797a added comment in README about controller tests for rails 5 2018-03-30 10:57:12 -03:00
Koichi ITO
dac90eeb80 Use update instead of update_attributes
`update_attributes` and `update_attributes!` will be deprecated in Rails 6.

Refer 5645149d3a
2018-03-29 15:39:24 -03:00
Wolfram Nikolas Müller
f220b992c3 add test for lazy loading hook 2018-03-29 15:32:46 -03:00
Wolfram Nikolas Müller
2bb8e1c236 Fix missing do block in config 2018-03-29 15:32:46 -03:00
Wolfram Nikolas Müller
e44a8b2d43 Include configuration for Turbolinks in devise initializer template 2018-03-29 15:32:46 -03:00
Wolfram Nikolas Müller
268bd69164 Allow people to extend devise failure app, through invoking ActiveSupport.run_load_hooks once Devise::FailureApp is loaded 2018-03-29 15:32:46 -03:00
Eden Rohatensky
d750709250 Use before_action instead of before_filter 2018-03-28 09:12:11 -03:00
Fred Ngo
c9a2d0654e Update sample code in Devise::Models::Authenticatable.
- DRY up some of the sample code by refactoring into smaller methods.
- ‘Namespace’ method names to reduce chances of conflict.
- Mark send_pending_devise_notifications, pending_devise_notifications, and render_and_send_devise_message as `private` since they are only used internally.
- Update comments.
2018-03-23 22:42:48 -03:00
Johan Kim
26723d9bbc cleanup in ToC 2018-03-23 10:05:31 -03:00
Leonardo Tegon
75f9e76f65 Prepare for 4.4.3 release 2018-03-17 20:44:00 -03:00
Leonardo Tegon
962cea2039 Create Devise::SecretKeyFinder
When supporting Rails 5.2 credentials on
https://github.com/plataformatec/devise/pull/4712, we ended up breaking
apps that were upgraded to Rails 5.2 and weren't using `credentials`
to store their `secret_key_base`. See
https://github.com/plataformatec/devise/issues/4807 for more context.
To fix it, we're now checking whether the key is present before using it.
Since there weren't any automated test for this - the conditionals were
in a Rails engine initializer - I've extracted it to a new class so that
we are able to test it easily.

Fixes #4807
2018-03-17 20:28:38 -03:00
Leonardo Tegon
64aad8b138 Fix Devise::Test::ControllerHelpers
This was broken on 3e23371b01 (diff-bafaaa60fc003e648eb4981c9add523eR142)
because of a call to the method `Devise::Test.rails5?` which is only
defined inside our test suite's rails app a45bbe1783/test/rails_app/config/boot.rb (L19)
This commits checks for the rails version directly.
2018-03-16 11:17:48 -03:00
Leonardo Tegon
0d279415f3 Prepare for 4.4.2 release 2018-03-15 09:56:15 -03:00
Leonardo Tegon
fc45f916d6 Update CHANGELOG.md 2018-03-15 09:48:59 -03:00
Leonardo Tegon
3722aa6296 Revert "Replace log_process_action to append_info_to_payload" 2018-03-15 09:43:12 -03:00
Leonardo Tegon
5664b19703 Ensure Devise isn't performing model validations 2018-03-14 15:21:07 -03:00
Leonardo Tegon
d870c0dced Check if the record is persisted in update_tracked_fields!
In some cases, invalid records could be created during the signup
process because we were calling `save(validate: false)` inside the
`update_tracked_fields!` method. See
https://github.com/plataformatec/devise/issues/4673 for more
information.
This was fixed on https://github.com/plataformatec/devise/pull/4674 by
calling `save` directly, but it caused some trouble and confusion since
it changed Devise's behavior significantly.
We talked about on https://github.com/plataformatec/devise/issues/4790
and it doesn't even make sense to call `save` on an object that isn't
persisted yet, so I've added a guard clause to the
`update_tracked_fields!` method.

Fixes https://github.com/plataformatec/devise/issues/4790
2018-03-14 15:21:07 -03:00
Danilo Araújo Silva
8ab7963e50 Creating a new section for controller configuration on devise.rb template
Creating a new section called `Controller configuration`.

An optional devise configuration is set `config.parent_controller` but this configuration is missing in the `devise.rb` template file.
2018-03-14 15:09:04 -03:00
Rafael França
d545fe3e3f Merge pull request #4784 from gmcnaughton/fix-controller-tests-content_type
Fixes #4783 - preserve content_type for unauthenticated test responses
2018-02-26 13:04:03 -05:00
Gordon McNaughton
3e23371b01 Preserve content_type for unauthenticated tests
In Rails 4, for unauthenticated controller tests which trigger the
failure app, ensure that the simulated failure response includes a
content_type (broken in bb44d42).

This works in Rails5, which parses the content-type header on-demand,
but not in Rails4 which requires setting the response's content_type
explicitly.

Fixes #4783.
2018-02-26 12:15:36 -05:00
Leonardo Tegon
6bda962547 Update CHANGELOG.md [ci skip] 2018-02-22 18:00:13 -03:00
Leonardo Tegon
f141bb57ec Update CHANGELOG.md [ci skip] 2018-02-22 17:59:33 -03:00
Rafael França
9001123b7e Merge pull request #4779 from Fudoshiki/master
Allow test rails 6
2018-02-22 14:30:01 -05:00
Yuri S
5919620b24 change right border 2018-02-22 21:55:17 +05:00
Justin Coyne
a45bbe1783 Test on Rails 5.2.0.rc1 (#4711) 2018-02-22 10:05:19 -03:00
Yuri S
2514c69d81 Allow rails 6 2018-02-21 07:18:36 +05:00
Leonardo Tegon
8b53975652 Improve documentation about the test suite (#4774) 2018-02-06 10:49:45 -02:00
Gencer W. Genç
bdd6081815 Support for :credentials on Rails v5.2.x. (#4712)
This fixes #4710.

Rails introduced :secrets in v5.1. They somehow changed it to :credentials. This fix represents this change.

Devise will now look :credentials first, then fallback to :secrets for 5.1.x compatibility then it will check for standard secret key. If three not found then exception will arise.
2018-01-23 19:19:29 -02:00
Leonardo Tegon
e55c9caa05 Prepare for 4.4.1 release 2018-01-23 15:03:41 -02:00
Leonardo Tegon
0f8695dd4b Update CHANGELOG.md [ci skip] 2018-01-23 13:31:26 -02:00
Alex Matchneer
d9deeba582 Fix signed_in? docs w.r.t. running auth hooks (#4733)
Addresses #4599

The docs previously mentioned that authentication hooks are not run when `signed_in?` is called, when in fact they are. This commit fixes the comment and suggests calling `authenticated?` on warden directly as an alternative for when you _don't_ want to run auth hooks.
2018-01-23 13:18:37 -02:00
Leonardo Tegon
d1948b79d3 Fix ActiveRecord check on Confirmable (#4752)
* Fix `ActiveRecord` check on `Confirmable`

As pointed out by @dark-panda in #4302, the condition for an
`ActiveRecord` model is wrong inside the `Confirmable` initialization
block.

https://github.com/plataformatec/devise/pull/4302#issuecomment-355103489

* Add specs
2018-01-16 10:25:20 -02:00
Rafael França
371d657e35 Merge pull request #4753 from segiddins/patch-1
[Gemspec] Ensure it is loaded as utf-8
2018-01-15 15:03:03 -05:00
Samuel Giddins
82087ce211 [Gemspec] Ensure it is loaded as utf-8 2018-01-12 21:26:42 -08:00
Leonardo Tegon
463351922f Update copyright [ci skip] 2018-01-03 21:20:13 -02:00
Leonardo Tegon
3080e9e018 Don't run ruby 2.5.0 with rails 4.1
https://github.com/rails/rails/issues/25125
2017-12-29 16:42:58 -02:00
Leonardo Tegon
caf633854d Run gem update --system before install on CI
There's an issue with the combination of Bundler `1.16.1` and rubygems `2.7.3`.
This command will install rubygems `2.7.4` in order to fix it.

https://github.com/travis-ci/travis-ci/issues/8978
2017-12-29 16:11:04 -02:00
Leonardo Tegon
f016e823cd Use rdoc 5.1 for ruby 2.1 on CI
`rdoc 6.0` requires ruby version >= `2.2.2`
2017-12-29 16:09:51 -02:00
Leonardo Tegon
9843cb27dc Run tests on ruby 2.5.0 2017-12-29 15:08:49 -02:00
Leonardo Tegon
50bbb56576 Prepare for 4.4.0 release 2017-12-29 14:34:02 -02:00
Leonardo Tegon
135d898e0e Update CHANGELOG.md 2017-12-26 07:59:48 -02:00
Filip Soszyński
b01ae718b3 Primary key type in migration template (#4426)
* Tests

* Add primary key type to migration template

* Change Rails version-detecting method in test
2017-12-23 17:20:45 -02:00
fjg
8c9cc8d355 Change the way to detect ActiveRecord vs Mongoid (#4302)
* Change the way to detect ActiveRecord vs Mongoid

Cause of **mongoid-paperclip** declaring *after_commit* callback while **mongoid** (and MongoDB) does not support it.

* Update test for ActiveRecord presence to handle Mongoid/ActiveRecord project
2017-12-23 16:39:39 -02:00
Anton Davydov
95689757c0 Delete unnecessary condition for helper method (#4359) 2017-12-22 15:38:45 -02:00
Rafael França
0720bc72c3 Merge pull request #4731 from alexhifer/master
Added the ability to change the default migrations path
2017-12-21 18:33:07 -05:00
Leonardo Tegon
5f1c210511 Update CHANGELOG.md [ci skip] 2017-12-21 17:15:01 -02:00
Mike Rogers
16b3d6d67c Adding autocomplete="email" to email fields (#4643)
As discussed in https://github.com/plataformatec/devise/issues/4635
2017-12-21 17:13:50 -02:00
Lutz Lengemann
7b3081760f Move failed_attempts increment into its a function (#4351)
With this change one can overwrite when the incrementation is handled without duplicating the other `valid_for_authentication` logic.
2017-12-21 16:49:09 -02:00
Olivier Lacan
5a3b7a1771 Clarify how store_location_for modifies URIs (#4391)
This fairly straightforward refactor extracts the most obtuse
portions of store_location_for into the following discrete
private methods:
- extract_path_from_location
- remove_domain_from_uri
- add_fragment_back_to_path

This may seem like indirection but it was very unclear what
operation was being performed on the location sent to
store_location_for prior to this change.

I considered documenting the behavior but the code seemed
like a prime candidate for method extraction.
2017-12-21 16:15:53 -02:00
Sai Chander
db011c0192 set_flash_method! instead of set_flash_method in omniauth callbacks controller (#4680) 2017-12-21 15:53:14 -02:00
Pat Allan
f39c6fd927 Add the frozen_string_literal pragma comment to all Ruby files. (#4725) 2017-12-21 15:36:29 -02:00
Guilherme Goettems Schneider
8b9fba73fd Allow frozen options in as_json (#4655)
The test uses `as_json` instead of `to_json` because `to_json` does `#dup` on `options` before it reaches `#serializable_hash` and the test would pass without the fix.
2017-12-21 15:23:25 -02:00
Alexey Degtyarev
12298ef968 Added the ability to change the default migrations path (introduced in Rails 5.0.3) 2017-12-21 17:12:19 +02:00
Paulo Henrique Castro
1b02534bef change validatable docs to match generator (#4727)
lib/generators/templates/devise.rb#L160
2017-12-19 08:34:45 -02:00
Shiva Bhusal
42b68d53a7 Adds Table of content to Readme.md (#4621)
* Adds Table of content to Readme.md

* adds 's' to content
2017-12-17 14:00:32 -02:00
Mark Donald Amobi
4f2e915833 minor grammar fix in rememberable documentation (#4550) 2017-12-07 23:16:27 -02:00
Ahmad hamza
f8c1ee0f90 Added nested attributes example for README (#4434) 2017-12-07 23:13:30 -02:00
Calvin Claus
2458334de6 added note about stopping spring (#4506)
For me it was necessary to stop spring for the route helpers to be defined.
2017-12-07 22:29:41 -02:00
Leonardo Tegon
451ba5362b Update changelog [ci skip] 2017-11-28 13:03:53 -02:00
Ashley Foster
31801fc9a0 Fix missing validations on Signup (#4674)
* Fix missing validations on Signup

This commit fixes issue
https://github.com/plataformatec/devise/issues/4673

This removes `validate: false` from saving a record when `Trackable` is
in use.

* Add test case

* Add mongoid model
2017-11-28 12:58:41 -02:00
Felipe Renan
ce0414271a Merge pull request #4704 from plataformatec/plataformatec/issue-template
Add issue template
2017-11-22 20:07:44 -02:00
Rafael França
701d4929d8 Merge pull request #4375 from fbbergamo/change-status-append
Replace log_process_action to append_info_to_payload
2017-11-22 15:53:28 -05:00
Felipe Renan
e61f4bae40 Add issue template
The issue template is a guide to help the contributors report issues.
2017-11-22 18:39:01 -02:00
Rafael França
88e9a85d6a Merge pull request #4694 from rpbaptist/devise_scope-doc
Provide additional info on devise_scope usage
2017-11-06 11:37:55 -05:00
Richard Baptist
d6ffa8ef22 Provide additional info on devise_scope usage 2017-11-06 17:25:29 +01:00
Rafael França
448106f458 Merge pull request #4692 from masatooba/fix-rake-to-rails
Change `rake secret` to `rails secret` in comments
2017-11-02 22:58:56 -04:00
Masato Oba
a88f88eb4b Change rake secret to rails secret in comments 2017-11-02 15:38:32 +00:00
Rafael França
2b10d517f6 Merge pull request #4683 from masatooba/remove-unnecessary-method
Remove unnecessary hide! method definition
2017-10-31 01:51:16 -04:00
Rafael França
4db1d819b0 Merge pull request #4682 from haneru/edit-gemfile
Removed gem minitest
2017-10-31 01:50:37 -04:00
Rafael França
840c2e7306 Merge pull request #4686 from kyoshidajp/fix_mongoid_failed_test
Fix mongoid test failed problem
2017-10-31 01:44:48 -04:00
Rafael França
657507b705 Merge pull request #4687 from masatooba/fix-spec-typo
Fix small typo in test
2017-10-30 15:33:35 -04:00
Masato Oba
975bb8490d Fix typo 'an user' to 'a user' 2017-10-29 12:31:06 +00:00
Masato Oba
6ceb649b10 Fix small typo in authenticatable_test.rb 2017-10-29 12:10:39 +00:00
Katsuhiko YOSHIDA
bcb67ecde8 Fix mongoid test failed problem 2017-10-28 15:56:32 +09:00
haneru
4184e23d71 bundle installed 2017-10-28 01:46:55 +09:00
masatooba
a24f98f315 Delete unnecessary hide! method
This method has already been added to Rails.
2017-10-28 01:26:26 +09:00
haneru
c74e2693a3 Removed gem minitest 2017-10-28 01:09:43 +09:00
Rafael França
7a7a099573 Merge pull request #4677 from bananaappletw/master
Remove TODO when Rails 5.0.3 is released
2017-10-23 15:07:09 -04:00
Rafael França
215d034b86 Merge pull request #4645 from swamp09/ci_against
CI against Ruby 2.2.8, 2.3.5, and 2.4.2
2017-10-20 13:34:04 -04:00
Vasiliy Ermolovich
3323197d68 Merge pull request #4668 from pat/mri2.5.0-fix
Fix syntax for MRI 2.5.0-preview1.
2017-10-14 16:25:23 +03:00
Pat Allan
1009096172 Fix syntax for MRI 2.5.0-preview1. 2017-10-13 10:38:43 +11:00
bananaappletw
197ac56520 Remove TODO when Rails 5.0.3 is released 2017-10-07 02:40:32 -07:00
swamp09
92b94bc84d CI against Ruby 2.2.8, 2.3.5, and 2.4.2 2017-09-16 23:40:57 +09:00
Rafael França
71fc5b351a Merge pull request #4565 from pat/frozen-string-literals
Ensure string literals can be frozen.
2017-06-21 14:16:43 -04:00
Pat Allan
4e9860d268 Ensure string literals can be frozen. 2017-06-21 09:22:49 +10:00
Rafael França
ad8547dede Merge pull request #4381 from slbug/master
remove warnings about default value with new thor
2017-06-13 15:51:20 -04:00
Lucas Mazza
079ed3b6f8 Update Changelog [ci skip] 2017-05-14 21:10:36 -03:00
Rafael Mendonça França
5e014ab607 Exclude Rails 4.1 in Ruby 2.4.1 2017-05-11 19:23:05 -07:00
Rafael Mendonça França
0f6014b84d Make sure we are using a version of minitest that is not broken with
Rails.
2017-05-11 19:06:29 -07:00
Rafael Mendonça França
b5629ebf1d Test with Rails 5.0 2017-05-11 19:00:04 -07:00
Lucas Mazza
ee01bac8b0 Update CHANGELOG. 2017-05-10 17:18:00 -03:00
Lucas Mazza
3e1c9e343c Add Devise.activerecord51?
Active Record changed it's public API, so we should check against its
version instead of Rails as it is possible to use Rails 5.1 with Mongoid,
which still has the older Dirty API.

However, this patch does not fixes a scenario where an app has both
Active Record and Mongoid loaded. It should be fixed by either normalizing
the Mongoid/ActiveRecord API or replacing the conditional method
definitions with a shim layer that abstracts this away.
2017-05-10 17:09:38 -03:00
Lucas Mazza
399774af69 Prepare for 4.3.0 release. 2017-05-10 16:50:40 -03:00
Rafael França
a62faa2c82 Merge pull request #4528 from mikevic/master
Update copyright licence year to 2017
2017-05-05 14:10:44 -07:00
Michael Kevin Victor
059dfc8cce Update copyright licence year to 2017 2017-05-05 18:28:30 +05:30
Rafael França
cc6a582408 Merge pull request #4523 from trammel/rails-5.1-render-text
Rails 5.1 fix: Replaced render :text 404 with :plain in omniauth
2017-05-03 10:49:24 -07:00
Jonathon Padfield
ce08d7abb8 Replaced render :text 404 with :plain in omniauth
Rails 5.1 has deprecated render :text, and HEAD requests on the
omniauth callbacks passthru method is causing errors because the render
:text is non-existant, and there's no template to fall back to.

Replacing :text with :plain, adds a content-type type of text/plain and
also returns the previous message.

render :plain was supported back in rails 4.1.0
http://api.rubyonrails.org/v4.1.0/classes/ActionView/Helpers/RenderingHelper.html#method-i-render
2017-05-03 13:31:52 +10:00
Rafael França
83213569dd Merge pull request #4516 from danschultzer/separate-devise-test
Separate Devise test methods from Devise
2017-04-29 23:18:58 -07:00
Dan Schultzer
be2e17841e Separate Devise test methods from Devise 2017-04-29 10:24:22 -07:00
Rafael Mendonça França
0591d92f53 Move the version check to the lib folder
Closes #4514.
Fixes #4513.
2017-04-29 10:12:51 -07:00
Rafael Mendonça França
244cc60d35 Remove deprecation on email_was 2017-04-28 16:07:27 -07:00
Rafael Mendonça França
94c6d5f5cc Remove deprecation on _changed? methods 2017-04-28 16:05:39 -07:00
Rafael Mendonça França
0fe308e7a7 Remove deprecation in the email_was method 2017-04-28 15:33:55 -07:00
Rafael Mendonça França
801cf00146 Test by default with Rails 5.1 2017-04-28 15:33:43 -07:00
Rafael França
83002017ea Merge pull request #4504 from schmartmann/master
update rake reference to rails
2017-04-28 15:17:26 -07:00
Rafael França
0263b8dbfc Merge pull request #4503 from xemexpress/master
Update copyright year to 2017
2017-04-28 15:17:08 -07:00
Rafael França
4beeca46c4 Merge pull request #4512 from jcoyne/rails-5.1
Rails 5.1
2017-04-28 15:16:35 -07:00
Matthew Rudy Jacobs
7c4e8c8d17 Rails 5.1 requires ActionController::TestRequest to have a controller class
Pass it in as an anonymous class
2017-04-28 10:51:27 -05:00
Matthew Rudy Jacobs
36613b09d7 Allow Rails 5.1 2017-04-28 10:51:27 -05:00
Stefan Hartmann
31774452e8 update rake reference to rails 2017-04-25 16:19:20 -04:00
Felipe Bergamo
6eb412efae Typo test doc 2017-04-24 18:38:49 -03:00
Jason Luo
244c22a6a2 Update copyright year to 2017 2017-04-07 22:36:22 +08:00
Carlos Antonio da Silva
7d3d6fb3f0 Release 4.2.1 2017-03-15 12:33:23 -03:00
Carlos Antonio da Silva
ce071502ee Display unconfirmed email when using reconfirmable and email changed notification
Otherwise we'd be mistakenly displaying the original email in the
message (which is the same we're sending the message to).

Also tweak the messaging a bit in this case, to show that the email "is
being changed" (the change hasn't taken effect yet).

Related to #4455.
2017-03-15 11:47:47 -03:00
Carlos Antonio da Silva
32f63b2fb9 Bundle update 2017-03-15 10:31:00 -03:00
Carlos Antonio da Silva
bacd9d244c Ensure both times are UTC when validating the confirmation period
The fact that we're setting them value as UTC doesn't necessarily mean
we're gonna get it back as UTC, so ensure both are converted to compare.
2017-03-15 10:22:01 -03:00
Carlos Antonio da Silva
a665aada25 Merge pull request #4461 from jjuliano/patch-1
Confirmation link validity is wrong in different time zone
2017-03-15 10:17:25 -03:00
Carlos Antonio da Silva
0c5d78e31c Merge pull request #4456 from victor-am/hotfix_absent_new_password_values
Fix absent password params from Password#update

Closes #4397.
2017-03-13 19:41:46 -03:00
victor-am
60dc4be8c1 Fix absent password params from Password#update
Related to issue #4397

This hotfix adds a string coercion to new_password paramenters when
trying to reset an user's password.

Before that, when a user submitted a password recovery form with the
new_password and new_password_confirmation params as nil, Devise would
sign in the user with a success notice but without actually changing the
password.
2017-03-10 14:29:25 -03:00
Carlos Antonio da Silva
f7b6d78606 Merge pull request #4455 from plataformatec/feature/confirmation-notification
Notify original email when it's changed
2017-03-10 09:34:06 -03:00
Carlos Antonio da Silva
c605758800 Add some basic tests for the email changed notification 2017-03-10 09:10:57 -03:00
Carlos Antonio da Silva
2135ae5e5e Change email_change => email_changed notification
This better indicates what the setting is for, and when it's supposed to
be triggered.

We might eventually deprecate the existing password_change on in favor
of password_changed.
2017-03-10 08:56:34 -03:00
Joel Bryan Juliano
a3d31778c2 Confirmation link validity is wrong in different time zone
Due to time zone difference, the confirmation link in email is invalid, this can be solved by using UTC for Time.now for confirmation_period_expired?
2017-03-08 19:36:41 +08:00
Carlos Antonio da Silva
d7f6855ad8 Add some docs to the send email/password notification settings [ci skip] 2017-03-06 17:33:34 -03:00
Carlos Antonio da Silva
0a9e2c961f Add changelog entry for new email change notification feature [ci skip] 2017-03-06 17:20:55 -03:00
Carlos Antonio da Silva
8387cc9474 When using reconfirmable, notify the original email about the change right away
Do not wait for the email change to be confirmed by the "unconfirmed
email" with reconfirmable: notify the original email right away.
2017-03-06 17:07:55 -03:00
Carlos Antonio da Silva
70eb18d766 Notify original user email when the email changes
This adds a new setting `send_email_change_notification` which will
send an email to the original user email when their email is updated to
a new one.

It doesn't take into account the reconfirmable setting yet, it will be
added next, so that if confirmable is included and reconfirmable is
being used, the email will be triggered when the email change is
requested, not when confirmed (e.g when we store the email in
`unconfirmed_email`, not when it's later copied to `email` when that is
confirmed).
2017-03-06 17:04:26 -03:00
Carlos Antonio da Silva
bf4641c8cf Skip running tests on Ruby 2.4 / head and Rails 4.1 2017-03-02 09:59:05 -03:00
Carlos Antonio da Silva
c76f0e59b7 Use assert_nil to prevent minitest warnings 2017-03-02 08:12:46 -03:00
Carlos Antonio da Silva
fa2d333bde Update Gemfile dependencies 2017-03-02 08:12:36 -03:00
Carlos Antonio da Silva
15a50dc8d7 Test against latest ruby versions 2017-03-02 08:11:08 -03:00
Carlos Antonio da Silva
a47928090a Merge pull request #4445 from gogovan/fix-strategy-class-tests
Fix Omniauth config tests
2017-03-02 08:10:03 -03:00
Matthew Rudy Jacobs
6fc6a28e3b Avoid the assert_equal nil deprecation warning 2017-02-26 22:05:15 +00:00
Matthew Rudy Jacobs
6bc2db4567 Fix Omniauth config tests 2017-02-26 21:52:51 +00:00
George Guimarães
5abdb65e56 Deprecate mailing list 2017-02-04 18:57:47 -02:00
Vasiliy Ermolovich
25a3eeb30a Merge pull request #4403 from bakongo/fix_name_of_module_in_rdoc
fix name of the module in the docs
2017-01-20 23:30:11 +03:00
Daniel Wiesmann
33d5335f53 fix name of the module in the docs 2017-01-19 13:03:10 +01:00
Alexander Grebennik
47077bf810 fix warnings about default value with new thor 2016-12-20 02:14:41 +03:00
Felipe Bergamo
9caae50339 Replace log_process_action to append_info_to_payload 2016-12-10 18:40:57 -02:00
Vasiliy Ermolovich
8a4d610c58 Merge pull request #4361 from lmatiolis/fix-authenticatable-name-on-exception
Fix authenticatable_salt name on exception text.
2016-11-27 23:30:28 +03:00
lmatiolis
3d2a908f64 Fix authenticatable_salt name on exception text. 2016-11-23 17:25:44 -02:00
Lucas Mazza
d2ea28b3db Merge pull request #4343 from ethirajsrinivasan/set_minimum_password_length_for_registration_update_path
set minimum password length after user registration update
2016-10-31 13:50:47 -02:00
ethiraj
7a44233fb9 set minimum password length after user registration update 2016-10-27 08:33:35 +05:30
Hiroo Takizawa
a9bb7d0318 Update README.md
change "bundle command" to the writing of "command line"
2016-10-19 22:54:41 +03:00
José Valim
ebe65b516b Merge pull request #4318 from kami-zh/improve-readme
Update README - Decrease stretches to 12
2016-10-05 18:29:42 +02:00
kami
ebf79be163 Update README - Decrease stretches to 12 2016-10-06 01:05:39 +09:00
Carlos Antonio da Silva
88724e10ad Merge pull request #4292 from rousisk/rousisk-readme-var-to-symbol
convert variable to symbol in readme
2016-09-13 15:41:50 -03:00
Konstantinos Rousis
30405943b5 convert variable to symbol in readme 2016-09-13 20:39:44 +02:00
Lucas Mazza
9c0dccfec1 Merge pull request #4284 from znz/strip_heredoc
Use `strip_heredoc` for deprecation warnings
2016-09-04 12:49:10 -03:00
Kazuhiro NISHIYAMA
9fe7040db9 Use strip_heredoc for deprecation warnings 2016-09-04 19:15:09 +09:00
Lucas Mazza
4c3838bb75 Merge pull request #4255 from olivierlacan/patch-2
Fix typos in failure_app comments
2016-08-15 19:05:39 -03:00
Olivier Lacan
48aa20897f Fix typos in failure_app comments 2016-08-15 15:51:11 -04:00
Vasiliy Ermolovich
2a5f8b6688 Merge pull request #4250 from marcgg/patch-1
Fix a minor typo in specs
2016-08-11 11:21:31 +03:00
Marc G Gauthier
8ee01fc10b Fix a minor typo in specs
There is nothing much to this one, it's in the test description so it shouldn't impact a thing and will make this line more greppable.
2016-08-11 09:56:45 +02:00
Carlos Antonio da Silva
d7985e7ddb Merge pull request #4247 from rthbound/updates-omniauth-url
Updates url for omniauth to omniauth/omniauth repo
2016-08-10 14:56:53 -03:00
Ryan T. Hosford
ae8b0914a9 Updates url for omniauth to omniauth/omniauth repo 2016-08-10 09:57:14 -05:00
Lucas Mazza
6720f93d2c Remove deprecated omniauth path from store_location docs [ci skip] 2016-07-26 10:10:49 -03:00
Lucas Mazza
13d4fd4088 Merge pull request #4193 from 3wille/master
add block passthrough to devise_mail
2016-07-22 15:14:51 -03:00
Vasiliy Ermolovich
bbd614a725 Merge pull request #4206 from nickharvey27/fix-typo
Fix small typo
2016-07-19 09:50:06 +03:00
nickharvey27
eb0540e028 fix small typo 2016-07-18 23:46:51 -07:00
Frederik Wille
08374f1d33 fix test 2016-07-18 09:24:46 +02:00
Frederik Wille
a5f8cd9d32 simplify test 2016-07-18 09:00:32 +02:00
Lucas Mazza
54e7a3b9d9 Devise::Mailer#scope_name and Devise::Mailer#resource shouldn't be public. 2016-07-15 16:02:43 -03:00
Carlos Antonio da Silva
e761a8df2b Merge pull request #4200 from amingilani/master
[Minor] Fix indentation in generators
2016-07-15 08:17:07 -03:00
Frederik Wille
65d8e94ed9 add test
in the test we need to declare a subclass of ``Devise::Mailer`` to give
a block to mail call inside of method which has a corresponding view
template

there are propably better ways to test this, but this is pretty much the
use case for passing a block
2016-07-15 12:22:12 +02:00
amingilani
83b88353b5 Fix indentation in generators 2016-07-15 13:22:51 +05:00
Lucas Mazza
39227bd494 Merge pull request #4194 from nviennot/orm_surface
Reduce ORM API surface
2016-07-13 21:03:31 -03:00
Nicolas Viennot
e841c4c5ef Reduce ORM API surface 2016-07-13 12:48:12 -04:00
Frederik Wille
e90ba2fbcb add block passthrough to devise_mail
ActionMailer's ``mail`` method may receive a block for customizing the mails
format
``devise_mail`` now has the same functionality by just
passing the block to ``mail`` call.

fixes plataformatec/devise#2341
2016-07-13 11:25:35 +02:00
Lucas Mazza
e6b5f5f31a Expand CONTRIBUTING.md [ci skip]. 2016-07-12 21:29:02 -03:00
Lucas Mazza
245b1f9de0 Update .travis.yml. 2016-07-01 14:22:38 -03:00
Lucas Mazza
e05523f767 Prepare for 4.2.0 release. 2016-07-01 14:15:14 -03:00
Lucas Mazza
2c8727ad42 Test against Rails 5 by default. 2016-07-01 14:13:20 -03:00
Lucas Mazza
b1508e93e1 Properly check for authentication_keys or encrypted_password changes when clearing the reset password token
This change is required to better support scenarios where records don't have
an `encrypted_password` column and the password is managed elsewhere (LDAP, for instance).

The move from `email_changed?` to loop through the `authentication_keys` is also
useful to support edge cases where users can authenticate with different attributes
besides their email.

Closes #3624.
2016-07-01 14:08:38 -03:00
Lucas Mazza
5b57aa0b85 Merge pull request #4175 from AnnaGulstine/master
Added clarification to README regarding Devise setup
2016-07-01 13:59:22 -03:00
AnnaGulstine
768656deb9 Added clarification to README regarding Devise setup 2016-06-30 21:15:32 -05:00
Lucas Mazza
fe10a5b17a Fix test typo and expand test cases for Rememberable#rememberable_value.
Closes #4157
2016-06-27 17:08:52 -03:00
Lucas Mazza
22784cb55a Remove ActiveRecord::Migration inheritance deprecation warning. 2016-06-27 16:50:26 -03:00
Lucas Mazza
656720583f Remove assert_nothing_raised deprecated usage. 2016-06-27 16:48:12 -03:00
Lucas Mazza
a20cca6873 Fix IllegalStateError for controller tests with custom strategies. 2016-06-27 16:43:57 -03:00
Lucas Mazza
8d78dc072f Disable Travis CI fast_finish.
Fast finish triggers multiple Slack notification and floods our OSS slack room,
and it is a known bug for a while.

Reference: travis-ci/travis-ci/issues/1696
2016-06-27 15:17:20 -03:00
Lucas Mazza
b2a2e85412 Update dependencies. 2016-06-27 15:13:47 -03:00
Lucas Mazza
c2c74b0a39 Use ActiveSupport.on_load to hook into Active Record and Mongoid. 2016-06-27 14:55:22 -03:00
Lucas Mazza
92bb772d36 Update CHANGELOG. 2016-06-27 14:55:22 -03:00
Lucas Mazza
783234c72a Merge pull request #4153 from krishandley/fix_env_deprecation_warning
Fix Rails 5 env deprecation warning
2016-06-27 14:44:49 -03:00
Lucas Mazza
2671f19cb1 Merge pull request #4169 from hamadata/fix_test_helper_for_rails5_rc2
Test cases (not signed-in 302 redirection) failed on Rails5 RC2
2016-06-27 14:35:12 -03:00
Lucas Mazza
72ea8392a8 Merge pull request #4168 from bgreg/patch-1
Update README.md
2016-06-27 14:30:03 -03:00
HAMADA Takayuki
bb44d422d6 not signed_in 302 redirect failed on Rails5 RC2 2016-06-26 06:02:58 +09:00
Greg
5d304ae63a Update README.md
Explain the `MODEL` replacement before the command is shown.
2016-06-25 11:36:11 -07:00
Kris Handley
0c991af985 Fix Rails 5 env deprecation warning
Full warning ```DEPRECATION WARNING: env is deprecated and will be removed from Rails 5.1```
2016-06-18 14:20:08 +01:00
Arne Zeising
ac702843dd Change behavior to skip reconfirmation after creating a record with #save called in callback (#4125)
https://github.com/plataformatec/devise/pull/4125
2016-06-13 17:57:24 -03:00
Kostas Diamantis
4015488b90 Add missing support of Rails.application.config.action_controller.relative_url_root (#4146)
* Add Devise::FailureApp#{relative_url_root, relative_url_root?}

Also support missing action_controller.relative_url_root configuration.

* Dry assignment of relative_url_root

Also this commit adds support for
Rails.application.config.action_controller.relative_url_root
2016-06-13 15:46:43 -03:00
Lucas Mazza
cccc137714 Merge pull request #4139 from shinyaK14/public_file_server
Add public_file_server setting for Rails5
2016-06-13 11:34:04 -03:00
Lucas Mazza
3fa0afad67 Merge pull request #4148 from jamescook/james/remove-session-inspect
Remove unnecessary 'warden.raw_session.inspect'
2016-06-13 11:33:33 -03:00
Lucas Mazza
29142418ba Merge pull request #4140 from tkrajcar/add-inspect-override
Implement Devise::Models::Authenticatable#inspect, re-using #serializable_hash
2016-06-13 11:24:27 -03:00
James Cook
c3b54dc0c2 Remove unnecessary 'warden.raw_session.inspect' 2016-06-10 20:14:11 -05:00
Tim Krajcar
a0232cf763 Implement Devise::Models::Authenticatable#inspect, re-using #serializable_hash. 2016-06-03 15:54:58 -07:00
Shinya Kitamura
57980ba82a Add public_file_server setting for Rails5 2016-06-01 14:44:35 +08:00
Carlos Antonio da Silva
bcdd54cc5e Merge pull request #4129 from laserlemon/patch-1
Self-love isn't entirely appropriate in this setting
2016-05-26 11:47:17 -03:00
Steve Richert
83d5d3142d Self-love isn't entirely appropriate in this setting 2016-05-26 09:25:44 -04:00
Stefan Botzenhart
cbbe932ee2 Fix authenticated engine routes (#4081)
Fix infinite loop in authenticated engine routes in Rails 5

https://github.com/plataformatec/devise/issues/3705
2016-05-21 11:55:56 -03:00
Lucas Mazza
593ae41f9d Update existing Gemfiles. 2016-05-18 13:59:06 -03:00
Lucas Mazza
e9770fd434 Update Rails 5 Gemfile. 2016-05-18 13:50:07 -03:00
Lucas Mazza
53f6785e11 Fix Rails version reference on README.md [ci skip] 2016-05-18 13:42:31 -03:00
Lucas Mazza
1b48fd0abe Fix syntax highlight on README [ci skip] 2016-05-18 09:39:04 -03:00
Lucas Mazza
b835059baf Merge pull request #4118 from kamipo/patch-2
Fix release date in CHANGELOG.md
2016-05-17 10:05:48 -03:00
Ryuta Kamizono
f7359d6d96 Fix release date in CHANGELOG.md 2016-05-17 22:00:22 +09:00
Lucas Mazza
4924dd68ae Raise a more informative error when request.env['warden'] is nil.
Previously, a `NoMethodError` exception would be raised from here when the
middleware stack isn't present and Warden wasn't injected as expected
(like in a controller test). To foolproof ourselves, we now raise a more
informative error when `request.env['warden']` is `nil` so developers can
figure this out on their own instead of reaching to the issue tracker for
guidance.
2016-05-16 15:23:25 -03:00
Lucas Mazza
02ed166f51 Update CHANGELOG [ci skip] 2016-05-16 14:45:30 -03:00
Lucas Mazza
9a11586a72 Merge pull request #4071 from plataformatec/lm-test-helpers
Introduce `IntegrationHelpers` and deprecate `Devise::TestHelpers`.
2016-05-16 14:39:22 -03:00
Lucas Mazza
b5a5bae09c Tidy up ControllerHelpers implementation a bit. 2016-05-15 19:55:24 -03:00
Lucas Mazza
e757543323 Revisit docs on test helpers on README.md 2016-05-15 19:47:42 -03:00
Lucas Mazza
7b000390a0 Add Devise::Test::IntegrationHelpers. 2016-05-15 19:36:41 -03:00
Lucas Mazza
3f3ec236bb Move Devise::TestHelpers to Devise::Test::ControllerHelpers. 2016-05-15 19:36:41 -03:00
Lucas Mazza
22dd3b489d Merge pull request #4115 from wbotelhos/patch-1
removes bugfix, from unreleased, already shipped
2016-05-15 19:35:35 -03:00
Lucas Mazza
0d45142845 CONTRIBUTING.md edits
* Wrap lines to around ~80 characters.
* Suggest reporting issues with fresh apps that replicate the issue.
* Mention our policy regarding internationalizing Devise views.
2016-05-15 19:30:14 -03:00
Lucas Mazza
62d6b5afb7 Mention the bug report test case on CONTRIBUTING.md. 2016-05-15 19:24:59 -03:00
Lucas Mazza
934fe45cfe Drop _master suffix as the bug template doesnt use Rails/Devise master. 2016-05-15 19:21:50 -03:00
Lucas Mazza
675ae4d802 Lock devise version on the bug report template. 2016-05-15 19:20:32 -03:00
Lucas Mazza
48251f236f Use single quotes consistently through the integration test example. 2016-05-15 19:19:27 -03:00
Lucas Mazza
8e6e70eaa7 Merge pull request #4087 from leonardoprg/master
fix #3958 adding helper test to report bugs
2016-05-15 19:16:26 -03:00
Washington Botelho
4925ffda31 removes bugfix, from unreleased, already shipped 2016-05-15 13:51:41 -03:00
Ulisses Almeida
f89921e153 📝 Update with minor patch releases 2016-05-15 12:22:45 -03:00
Ulisses Almeida
863b811167 📝 Update CHANGELOG 2016-05-15 11:58:02 -03:00
Lucas Mazza
d1f8884ee6 Merge pull request #4105 from giedriusr/features/update_example_in_authenticatable
Update example code in authenticatable model
2016-05-15 11:49:02 -03:00
Ralin Chimev
9caf07dd4f Fix overwriting the remember_token when a valid one already exists (#4101)
The remember_token should not get overwritten when a user is
signing in and a valid token already exists.

Fixes #3950.
2016-05-15 11:48:12 -03:00
Ulisses Almeida
2044fffa25 Deprecate the bypass option of sign_in (#4078)
The sign_in method permits the bypass option
that ignore the others options used. This behavior
has lead some users to a misconfusion what the
method really does.

This change deprecate the bypass option in favor
of a method that only does the sign in with bypass.

Closes #3981
2016-05-15 11:46:48 -03:00
Giedrius Rimkus
2e442d81f7 Update example code in authenticatable model 2016-05-12 15:47:04 +03:00
Steven Spiel
28f0e3281a Consistency of quotation marks in README (#4103)
* Change double to single quotes in ruby code blocks

For consistency, I switched some of the double quotes to single quotes in the ruby code blocks.
2016-05-11 23:06:40 -03:00
Lucas Mazza
6a0d881554 Merge pull request #4104 from LucasAU/fix-omniauth-changeog
Fix suggested omniauth path
2016-05-11 22:37:32 -03:00
Lucas Nelson
4a9eee5a1c Fix suggested omniauth path
The suggested omniauth path noted in the CHANGELOG.md under 4.0.0.rc2 
did not work. It was missing an `_omniauth` in the middle of the 
method name.

user_github_authorize_path => user_github_omniauth_authorize_path
2016-05-12 10:24:47 +10:00
Vasiliy Ermolovich
a4d3b9f14a Merge pull request #4100 from shinyaK14/update_readme
Update README.md
2016-05-11 09:19:26 +03:00
Shinya Kitamura
1beac93961 Update README.md 2016-05-10 22:11:12 +08:00
Maarten van Vliet
8286325fd0 Remove reference to Rails 3.2 in post-install text (#4094) 2016-05-08 13:41:46 -03:00
Lucas Mazza
228f24c491 Merge pull request #4092 from bogdanvlviv/patch-5
Update .travis.yml
2016-05-06 22:11:57 -03:00
bogdanvlviv
cff78eec23 Update .travis.yml 2016-05-06 23:05:03 +03:00
Leonardo
20d786d7ca fix #3958 adding helper test to report bugs 2016-05-05 23:13:00 +01:00
Lucas Mazza
0c1b1a896f Update CHANGELOG [ci skip]. 2016-05-05 17:23:19 -03:00
Lucas Mazza
db8e247aa5 Document reload_routes on the app file template. 2016-05-05 17:23:05 -03:00
Lucas Mazza
e01fdba557 Merge pull request #4053 from sidonath/make-route-reloading-configurable
Make reloading of routes optional
2016-05-05 17:18:43 -03:00
Lucas Mazza
0a1e55f11c Update CHANGELOG [ci skip]. 2016-05-05 17:17:48 -03:00
Matt Yanchek
85bcbdf18b Set minimum password length for edit and new views (#4068)
* Set minimum password length for edit and new views

* Update edit.html.erb

* Update registerable_test.rb
2016-05-05 17:16:41 -03:00
Lucas Mazza
a45c4c0ac4 Update CHANGELOG.md. 2016-05-05 17:14:27 -03:00
Lucas Mazza
d293e00ef5 Merge pull request #4083 from plataformatec/lm-rm-deprecations
Remove deprecated APIs
2016-05-05 17:07:53 -03:00
Lucas Mazza
201a4f92c2 Remove deprecated Devise::Models::Recoverable#after_password_reset method. 2016-05-03 18:33:08 -03:00
Lucas Mazza
71f90c0d6e Remove deprecated Devise::Models::Recoverable#reset_password! method. 2016-05-03 18:33:08 -03:00
Lucas Mazza
26e22d8e95 Remove deprecated Devise::Models::Confirmable#confirm! method. 2016-05-03 18:33:08 -03:00
Lucas Mazza
9805728964 Remove deprecated Devise.bcrypt method. 2016-05-03 18:32:56 -03:00
Lucas Mazza
f64022a57b Remove deprecated OmniAuth URL helpers. 2016-05-03 18:32:56 -03:00
Lucas Mazza
e79201aef8 Remove deprecated ParameterSanitizer API. 2016-05-03 18:32:47 -03:00
Lucas Mazza
a2498074f1 Replace custom Array assertion with assert_equal. 2016-05-03 14:18:35 -03:00
Lucas Mazza
536279b05b Replace homemade assert_not matcher in favor of refute. 2016-05-03 13:57:10 -03:00
Lucas Mazza
031351224a Remove usage of ActiveSupport::Dependencies 3.x API. 2016-05-03 13:52:33 -03:00
Lucas Mazza
74ab3e9a05 Remove references to ActiveSupport::OrderedHash.
We no longer support legacy rubies where hashes aren't ordered, so we don't need
to use this class for it.
2016-05-03 13:48:42 -03:00
Ulisses Almeida
1bc9ebd7de Release 4.1.0 2016-05-02 23:51:49 -03:00
Ulisses Almeida
81869de9c5 Only set raise_in_transactional_callbacks for Rails 4.2
* Only set for active record orm.
* Only set for Rails versions that supports the config.
2016-05-02 23:22:51 -03:00
Ulisses Almeida
f6301c08f6 Add raise_in_transactional_callbacks to true
Using a rails app without this config generates a rails
warning, since it will be the new default. Let's udpate it.
2016-05-02 22:41:51 -03:00
Ulisses Almeida
d66d9297fb 📝 Update the CHANGELOG 2016-05-02 22:34:07 -03:00
ALLEN WANG QIANG
78bbf6dcc4 Send on create confirmation email after commit (#4064)
Call send_on_create_confirmation_instructions in after_commit instead of after_create, I think this is no harm in general and it makes things like async job work.

Fix #4062
2016-05-02 21:32:14 -03:00
Ulisses Almeida
1ff64fbbd3 Merge pull request #4076 from f3ndot/issue-4072-unlock-strategy-enabled-bug
Fix strategy checking in #unlock_strategy_enabled? for :none and undefined strategies
2016-05-02 21:28:49 -03:00
Justin Bull
3226ab16c1 Extract list of both strategies into class constant 2016-05-02 14:22:09 -04:00
Lucas Mazza
13285d7ef3 Remove a few Ruby syntax warnings from the test suite. 2016-05-02 10:47:05 -03:00
Justin Bull
7346ce709a 🪲 Fix strategy checking in #unlock_strategy_enabled? for :none and undefined strategies
A bug that if the unlock strategy was set to `:both`, it would return true for all & any inputs

See #4072
2016-05-01 13:56:12 -04:00
Ulisses Almeida
8ac32f14b1 Merge pull request #4061 from plataformatec/ua-remove-config-deprecations
Set the new defaults for Devise 4.1

In our configuration template we explicit set some configurations as recommended defaults.
Now we are enforcing these configurations to be the defaults.
It also removes all warning code about this change.
2016-05-01 13:12:21 -03:00
Ulisses Almeida
91ef42dc0a Remove remaining code of setup deprecation warning
Since all configurations are using the current
recomended defaults. We can remove this deprecation
warning for Devise 4.1.
2016-05-01 12:44:40 -03:00
Ulisses Almeida
1ddca80cee Set the new default of sign_out_via config 2016-05-01 12:44:40 -03:00
Ulisses Almeida
896521be73 Se the new default for skip_session_storage config 2016-05-01 12:44:40 -03:00
Ulisses Almeida
6e419ce821 Set the new default for reconfirmable config 2016-05-01 12:44:40 -03:00
Ulisses Almeida
93df02f601 Set the new default for strip_whitespace_keys config 2016-05-01 12:44:40 -03:00
José Valim
fdd9337b64 Merge pull request #4066 from sbc100/friendly_token
Friendly token
2016-04-30 10:03:04 +02:00
Lucas Mazza
2040b021e1 Extend the deprecation horizon for the ParameterSanitizer and the OmniAuth helpers. 2016-04-29 16:20:01 -03:00
Sam Clegg
d122faf410 Use friendly_token over token_generator when only raw value is needed
The first value returned by token_generator.generate is
simply the return value of friendly_token so this code should
be equivalent.

The use of token_generator here dates back to when the
confirmation_token was stored as a digest, but that is no
longer true.
2016-04-27 10:44:15 -04:00
Sam Clegg
eaa4713e22 Consistent use of save method 2016-04-26 15:16:13 -04:00
Ulisses Almeida
0c1a14e8f2 📝 Update the CHANGELOG 2016-04-26 11:32:15 -03:00
byzg
357ce9c3b5 Humanize authentication keys in failure flash message (#4014)
Humanize and translates the authentication keys in failure flash message.
2016-04-26 11:17:03 -03:00
kimgb
830d3e86ee updated email_regexp and added test cases (#4001)
Add a more permissive default e-mail regex.
2016-04-26 11:13:07 -03:00
Philipe Fatio
209b97d86b Remove upgrade path for old session format (#4032)
This removes an upgrade path that migrated the old serialization format
to the new one introduced. This was introduced in c22d755 (#2300)
3 years ago and should no longer be needed.
2016-04-26 11:10:55 -03:00
Ulisses Almeida
4da955d9cd Release 4.0.1 2016-04-25 17:06:05 -03:00
Ulisses Almeida
bff701758a Merge pull request #4043 from lmduc/master
Send confirmation instructions when a user updates the email address from nil
2016-04-25 16:42:55 -03:00
Ulisses Almeida
90acc6fc23 Change the check for permit! method
We are using the `permit!` method, we should check
for `permit!`.
2016-04-22 20:36:55 -03:00
Damir Zekic
eba2527b8e Make reloading of routes optional
As has been seen in a previous pull request, some applications require
routes to be loaded before the code is eagerly loaded, which implies
that all Rails applications using Devise need to have routes reloaded
twice:
https://github.com/plataformatec/devise/pull/3241

This can incur a very significant slowdown for large apps that have a
lot of routes or a lot of controllers, so reloading should be optional.
2016-04-21 00:10:17 -03:00
Ulisses Almeida
48220f087b Merge pull request #4050 from cadejscroggins/master
Make sure attribute_will_change! method exists before calling it
2016-04-20 23:10:25 -03:00
Cade Scroggins
26b17abb01 Remove attribute_will_change! method as it is unnecessary 2016-04-20 20:23:03 -05:00
Lucas Mazza
22468f3756 Merge pull request #3855 from joshsoftware/mongoid_dep
Upgrade Mongoid to 5.0
2016-04-19 10:14:26 -03:00
Yogesh Khater
9696d83e7d Upgrade Mongoid to 5.0 2016-04-19 17:18:40 +05:30
Lucas Mazza
940ca4f2b8 Release 4.0.0. version. 2016-04-18 11:52:49 -03:00
Ulisses Almeida
f38250245f 📝 Update CHANGELOG 2016-04-18 11:46:29 -03:00
Ulisses Almeida
4c7c27f73e Merge pull request #4044 from plataformatec/ua-remember-me
Remove deprecated argument of `remember_me!`
2016-04-18 11:45:46 -03:00
Ulisses Almeida
7a235849cf Remove deprecated argument of remember_me! 2016-04-18 11:14:01 -03:00
Ulisses Almeida
846ba80480 Merge pull request #4039 from plataformatec/ua-fix-remember-me
Fix extented remember me
2016-04-18 11:07:02 -03:00
Ulisses Almeida
93d98b6450 Merge pull request #4036 from plataformatec/ua-defaults-review
Add warning about default config change
2016-04-18 11:06:32 -03:00
MatBi
7d10019d2a Should check email present 2016-04-18 19:52:31 +08:00
MatBi
274f8f2f87 Should send confirmation instructions after changing email from nil 2016-04-18 19:35:56 +08:00
MatBi
3360b10c2f Skip reconfirmation in case that a record is created with #save called in callback 2016-04-18 19:32:54 +08:00
MatBi
6f9561e64f Refactor a test 2016-04-18 18:30:20 +08:00
MatBi
016b216d95 Change the name of variables to keep the tests consistent 2016-04-18 18:15:32 +08:00
Ulisses Almeida
164134c78a Add warning about default config change
This change add warnings for these configurations:

* strip_whitespace_keys - It is already explicit on config template, now
it will be the same of the template.
* email_regexp - In the new version this regexp will be more
permissive.
* reconfirmable - It is already explicit on config template, now
it will be the same of the template.
* skip_session_storage - It is already explicit on config template, now
it will be the same of the template.
* sign_out_via - It is already explicit on config template, now
it will be the same of the template.

These ones is important to change, since the configuration says current
explicit value are the default. It can lead to misunderstanging if users
remove the explicit configuration.

It also updates the template explicit values:

* Warns the `config.mailer_sender` is nil by default
* Update `config.password_length` to use the current default
* Make the e-mail configuration explicit
2016-04-15 20:31:54 -03:00
Ulisses Almeida
4a4b5ba196 Fix remember me always extending the period
Now the config `extend_remember_period` is used to:

`true` - Every time the user authentication is validated, the
cookie expiration is updated.
`false` - Does not updates the cookie expiration.

Closes #3994
2016-04-15 20:28:46 -03:00
Lucas Mazza
c87d8fda82 Merge pull request #4041 from plataformatec/ua-fix-rails5-build
Fix Rails 5 build
2016-04-15 17:50:04 -03:00
Ulisses Almeida
48af3e8249 Fix Rails 5 build
With this [PR](https://github.com/rails/activemodel-serializers-xml/pull/8)
of activemodel-serializers bundle will require it by default.
2016-04-15 16:57:35 -03:00
Ulisses Almeida
57d150e535 Merge pull request #4031 from tomkadwill/readme_changes
Update README
2016-04-12 11:26:47 -03:00
Carlos Antonio da Silva
d9f97fc9a4 Merge pull request #4035 from bogdanvlviv/deprecated
fix method name for File
2016-04-12 07:40:29 -03:00
Tom Kadwill
9cdf7860d5 Update README 2016-04-12 09:22:16 +01:00
bogdanvlviv
0f11c0f6b3 fix method name for File 2016-04-12 09:03:54 +03:00
Ulisses Almeida
9914ff32ec Merge pull request #4004 from bogdanvlviv/patch-4
removed deprecated private method Devise::Controllers::Helpers#expire_session_data_after_sign_in!
2016-04-11 16:30:36 -03:00
Lucas Mazza
728bf0c956 Merge pull request #4033 from codeodor/patch-2
Note change to Rails 5 that affects Devise example
2016-04-10 18:49:30 -03:00
Sammy Larbi
c520e93733 Note change to Rails 5 that affects Devise example
[A change in Rails 5](3979403781) left me hunting for hours on why I could no longer log in to my application. To save others the trouble, I thought it would be nice to note it in the README.
2016-04-09 17:55:20 -05:00
Ulisses Almeida
b397d33246 Merge pull request #4005 from bogdanvlviv/dependencies
change rails version from 4.2.5 to 4.2.6
2016-04-08 17:04:02 -03:00
Bogdan
aa25e2080e removed deprecated private method Devise::Controllers::Helpers#expire_session_data_after_sign_in! 2016-03-30 18:10:16 +03:00
Carlos Antonio da Silva
2b3799e6ce Merge pull request #4010 from bogdanvlviv/patch-5
Update .travis.yml
2016-03-26 09:22:33 -03:00
Bogdan
2af3a83ef4 Update .travis.yml 2016-03-26 03:48:33 +02:00
bogdanvlviv
c3c2438c9c change rails version from 4.2.5 to 4.2.6 2016-03-23 21:21:58 +02:00
Lucas Mazza
69bee06cee Merge pull request #3993 from totothink/master
unified use pending_reconfirmation? method
2016-03-12 14:34:21 -03:00
aaron
c70eb0a5a8 unified use pending_reconfirmation? method 2016-03-12 07:10:20 +08:00
Lucas Mazza
db901399f2 Fix Symbol syntax no deprecation message. 2016-03-09 15:59:00 -03:00
Lucas Mazza
d0e5a1d252 Update CHANGELOG [ci skip] 2016-03-09 11:34:14 -03:00
Lucas Mazza
ccda4692b4 Add a bin/test executable to use Rails 5 Minitest report. 2016-03-09 11:16:21 -03:00
Lucas Mazza
e6563bc4cb Update Gemfile's dependencies. 2016-03-09 11:13:04 -03:00
Lucas Mazza
1c2328bb90 Prep for 4.0.0.rc2 release. 2016-03-09 11:01:50 -03:00
Lucas Mazza
9ec126bd8b Update CHANGELOG [ci skip] 2016-03-09 11:00:04 -03:00
Lucas Mazza
b3cc3db49e Merge pull request #3991 from plataformatec/lm-deprecate-old-omniauth-helpers
Deprecate legacy OmniAuth URL helpers.
2016-03-09 10:55:33 -03:00
Lucas Mazza
5b1182460c Deprecate legacy OmniAuth URL helpers. 2016-03-09 10:36:39 -03:00
Lucas Mazza
76f76249e7 Merge pull request #3985 from plataformatec/lm-omniauth-route-helpers
Do not use the dynamic `:action` segment on Omniauth routes.
2016-03-07 11:50:35 -03:00
Lucas Mazza
353b14f473 Use versioned migrations when possible
Rails 5 deprecates inheriting directly from `ActiveRecord::Migration` in
favor of inheriting from `ActiveRecord::Migration[5.0]` where `5.0` is
the `major.minor` version of Rails that the migration was originally
written to support.

h/t to b0ce189c69.
2016-03-07 11:38:37 -03:00
Lucas Mazza
ec07bdb315 Do not use the dynamic :action segment on Omniauth routes.
This was deprecated on rails/rails#23980.

We now generate scope and provider specific routes, like `user_facebook_omniauth_callback`
or `user_github_omniauth_callback`.

We could deprecate the `omniauth_authorize_path` in favor of the generated routes, but
the `shared/links.html.erb` depends on it to generate all omniauth links at once.

Closes #3983.
2016-03-07 11:19:27 -03:00
José Valim
9ece7da447 Merge pull request #3984 from jeroenvisser101/remove-trailing-whitespace-from-view
Remove trailing whitespace from confirmation view
2016-03-07 13:08:53 +01:00
Jeroen Visser
b214333760 Remove trailing whitespace from confirmation view
Though not a real issue, it was highlighted as an error by my commit
hooks, so I took the opportunity to fix it.
2016-03-07 10:07:34 +01:00
Vasiliy Ermolovich
3423043759 Merge pull request #3961 from anthonyto/clarify_confirmation_comments
Clarify allow_unconfirmed_access_for comments in confirmation module
2016-02-18 09:54:06 +03:00
Anthony To
8c636ef08a Clarify allow_unconfirmed_access_for comments in confirmation module 2016-02-18 13:35:13 +11:00
Lucas Mazza
a9b94f5eb9 Update CHANGELOG. 2016-02-15 10:19:08 -02:00
Lucas Mazza
c228227bc1 Tweak no ORM check on InstallGenerator.
* Expand the explanation of why it fail.
* Raise a subclass of `Thor::Error` so the Thor doesn't output the exception
  backtrace as it isn't useful for developers facing this error.
2016-02-15 10:16:43 -02:00
José Valim
0c46373c20 Merge pull request #3954 from arjunsharma/master
Raise error if no ORM is found during install generator
2016-02-14 23:11:05 +01:00
Arjun Sharma
648ed3b412 Raise error if no ORM is found during install generator 2016-02-14 14:59:38 -07:00
Lucas Mazza
cecb3ee45b Merge pull request #3921 from oss92/reduce_complexity
Added DeviseController#set_flash_message!
2016-02-11 14:38:03 -02:00
George Guimarães
4585281da4 Devise is already thread-safe and has been working in production on both YARV and JRuby. 2016-02-11 13:29:42 -02:00
George Guimarães
014859ecff Merge branch 'gg-correct-encryption-meaning' 2016-02-11 13:25:49 -02:00
George Guimarães
1f36946f43 Merge pull request #3941 from SimonDKnight/FixDocumentationTestHelpers
Added clarity to documentation regarding where to place test helpers …
2016-02-10 23:42:19 -02:00
George Guimarães
9efc601c73 Merge branch 'jetheredge-patch-2' 2016-02-10 23:28:13 -02:00
Justin Etheredge
dc7e7d66c9 Increase default stretches to 11 2016-02-10 23:27:21 -02:00
oss92
18528650c3 Added DeviseController#set_flash_message! 2016-02-11 02:49:53 +02:00
Simon Knight
a371f03c51 Update README.md
Added formatting to file.
2016-02-10 21:11:57 +00:00
José Valim
f173040222 Merge pull request #3946 from plataformatec/gg-remove-hakiri
Removes Hakiri, since it thinks Devise is a Rails app
2016-02-10 22:06:46 +01:00
George Guimarães
b74235d4a1 Removes Hakiri, since it thinks Devise is a Rails app
I'd like to remove the Hakiri badge from devise's README.

Since we do check in Gemfile and Gemfile.lock for development
and testing purposes (contrary to the popular belief that gems
don't need those files), Hakiri thinks Devise is a Rails app,
instead of a library/gem.

Depending on the Rails version that is locked in Gemfile.lock,
Hakiri will show several CVEs for Rails. But our Travis pipeline
builds against several Rails' branches, all of them updated.

And it is up to the developers using Devise to update
Rails in their apps.

Those warnings (Rails CVEs) don't make sense for devise.
2016-02-10 18:43:33 -02:00
George Guimarães
4b8ea5d0f0 Updates the development/testing dependencies 2016-02-10 18:37:16 -02:00
George Guimarães
79e861b52b Reorder travis builds to prioritize newer ruby and rails versions 2016-02-10 17:20:36 -02:00
George Guimarães
c4b4411513 Change encryption for hashing in the documentation.
Throughout the documentations, we are using 'encrypt' incorrectly.
Encrypt means that someone will eventually decrypt the message,
which is obviously not the case for Devise.

I'm changing the docs to use 'hashing' instead.

However, I left the database field as `encrypted_password` for now.
I'll update the db field in an upcoming PR.
2016-02-10 17:10:52 -02:00
Lucas Mazza
7b33a8ef57 Merge pull request #3931 from giantmonkey/fix-spelling-of-verb-set-up
Spell verb *set up* with a space
2016-02-10 17:06:38 -02:00
Simon Knight
1dd315ce1d Added clarity to documentation regarding where to place test helpers for functional tests 2016-02-09 13:29:42 +00:00
José Valim
7c75ebe672 Merge pull request #3936 from bogdanvlviv/patch-3
Update confirmable_test.rb
2016-02-06 20:11:11 +01:00
bogdanvlviv
d9481ff9b8 Update confirmable_test.rb 2016-02-06 20:37:31 +02:00
Carlos Antonio da Silva
f0c39e08ca Merge pull request #3934 from bogdanvlviv/patch-2
change call deprecated method confirm! to confirm in test
2016-02-03 18:15:39 -02:00
Bogdan
d3fa53151a change call deprecated method confirm! to confirm in test 2016-02-03 22:09:38 +02:00
Paul Menzel
f2d7b8f740 Spell verb *set up* with a space
The verb *set up* is spelled with a space [1].

```
$ git grep -l 'to setup' | xargs sed -i 's/to setup/to set up/g'
$ git grep -l '# Setup' | xargs sed -i 's/# Setup/# Set up/g'
$ git grep -l "test 'setup" | xargs sed -i "s/test 'setup/test 'set up/g"
```

Revert the change for *setup block yields self*.

Change the rest manually.

[1] http://www.merriam-webster.com/dictionary/set%20up
2016-02-02 19:09:19 +01:00
Lucas Mazza
beb8cc8e0b Test against Rails 5 beta 2. 2016-02-02 14:28:34 -02:00
Lucas Mazza
17d6a74909 oauth2 1.1.0 is out. 2016-02-01 10:39:10 -02:00
Lucas Mazza
aab7610808 Release 4.0.0.rc1. 2016-02-01 09:20:42 -02:00
Lucas Mazza
8edee143e8 Prep for 4.0.0.rc1 release. 2016-01-31 17:05:16 -02:00
Lucas Mazza
49cf804c62 Merge pull request #3859 from twalpole/unsafe_h
Explicitly permit rather than using to_unsafe_h
2016-01-31 16:56:10 -02:00
Lucas Mazza
8ab738307e Merge pull request #3927 from plataformatec/lm-cookie-fix
Attempt to coerce the `generated_at` cookie to a `Time` object.
2016-01-31 16:23:31 -02:00
Carlos Antonio da Silva
9d9adc73cd Merge pull request #3928 from gfvcastro/remove-optional-parenthesis
Remove optional parenthesis.
2016-01-30 18:08:50 -02:00
Gustavo Villa
91f93b38ee Remove optional parenthesis. 2016-01-30 14:20:32 -03:00
Lucas Mazza
7bff3be869 Attempt to coerce the generated_at cookie to a Time object.
Time objects aren't properly coerced back when using the JSON cookie serialization,
so we need to do it ourselves.

To avoid any new JSON serialization issues, we now store the `generated_at` as
an String with the timestamp seconds + miliseconds in the cookie but still the
previous JSON encoded format.

Thanks to @boblail at https://github.com/plataformatec/devise/pull/3917 for the
initial patch.
2016-01-29 18:04:16 -02:00
Lucas Mazza
475599d4ab Merge pull request #3926 from schneems/schneems/fix-version
[close 3925] Fix version for older Bundler compat
2016-01-29 14:57:42 -02:00
schneems
7d81731d4f [close 3925] Fix version for older Bundler compat 2016-01-29 10:56:13 -06:00
Lucas Mazza
ffe9d6d406 Fix Symbol syntax on ParameterSanitizer deprecation message. 2016-01-28 11:10:15 -02:00
Lucas Mazza
cf7c9be6b4 Merge pull request #3919 from twalpole/gemfiles
switch to oauth2 home repository
2016-01-27 15:58:57 -02:00
Thomas Walpole
3e80c9a80f switch to oauth2 home repository 2016-01-27 09:03:01 -08:00
Lucas Mazza
c6cf035037 Merge pull request #3918 from plataformatec/lm-serialized_in_cookie
Refactor `Rememberable#serialized_in_cookie?` to split class/instance API
2016-01-27 14:44:12 -02:00
Lucas Mazza
6008885152 Refactor Rememberable.serialized_in_cookie? to split class/instance API.
We now expose a `remember_me?` instance method as internal API for the controller
layer check if the remember me cookie is still valid.
2016-01-27 14:11:26 -02:00
Lucas Mazza
0c7f8764c9 Bump Gemfile dependencies. 2016-01-27 13:52:37 -02:00
José Valim
d1d8c2f03d Ensure generated_at is a Time
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2016-01-25 11:17:18 +01:00
José Valim
b97b3e6e3b Do not timeout if remember me is enabled
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2016-01-22 16:19:10 +01:00
Lucas Mazza
cc02d06c58 Remove Rails 3.2 compatibility fix. 2016-01-18 13:59:27 -02:00
Lucas Mazza
b91bbb1590 Tweak ParameterSanitizer exception/deprecation messages. 2016-01-18 13:51:51 -02:00
José Valim
52b1ca2d80 Bump to dev version 2016-01-18 15:22:00 +01:00
José Valim
4ec7dc0f27 Store creation timestamp on remember cookies
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2016-01-18 15:17:25 +01:00
Lucas Mazza
0a4da78b22 Add a notice to README regarding the sanitizer API change. 2016-01-17 12:53:31 -02:00
José Valim
aa3f64976f Merge pull request #3898 from kulte/master
Consistent formatting of file arguments to autoload
2016-01-13 23:10:38 +01:00
Zachary Friedman
260fa1a2e2 It would appear that consistency with the indentation used in the top-level Devise module would dictate this formatting change 2016-01-13 14:03:21 -08:00
José Valim
a321282ccc Merge pull request #3893 from retrospective5/updated-readme
Add link to devise_for documentation
2016-01-07 22:37:30 +01:00
araa
6f91baf99c Add link to devise_for documentation 2016-01-07 14:37:02 -05:00
José Valim
1a7f2195a2 Merge pull request #3891 from obduk/parent_mailer
Add parent_mailer to lib/generators/templates/devise.rb
2016-01-06 14:08:26 +01:00
Owen Davies
e5797001a7 Add parent_mailer to lib/generators/templates/devise.rb 2016-01-06 13:00:54 +00:00
Lucas Mazza
f0b937c538 Test against Ruby 2.3.0. 2016-01-05 14:48:10 -02:00
Carlos Antonio da Silva
9639bf8cc1 Merge pull request #3883 from Atul9/master
Update copyright notices to 2016 [ci skip]
2016-01-04 10:42:13 -02:00
José Valim
27e1588685 Merge pull request #3885 from dcmorse/master
Documentation clarification to README.md
2016-01-04 09:59:23 +01:00
Dave Morse
42fac75e8e Clarify previous clarification to README.md 2016-01-03 17:06:34 -05:00
Dave Morse
37b7e9b850 README.md: clarified how to include Devise::TestHelpers for :view tests.
Also clarified that including Devise::TestHelpers during integration tests is a mistake.
source: https://github.com/plataformatec/devise/issues/3881
2016-01-03 16:50:47 -05:00
Atul Bhosale
48e26c5d0a Update copyright notices to 2016 [ci skip] 2016-01-03 15:58:16 +05:30
Lucas Mazza
1d77099861 Merge pull request #3875 from james/master
Update controller generator templates for new ParameterSanitizer syntax
2015-12-27 22:53:01 -02:00
James Darling
924a989f37 Update controller generator templates for new ParameterSanitizer syntax
Devise::ParameterSanitizer has a new syntax for permitting additional
attributes to a model. This commit updates the generated controllers to
reflect that.
2015-12-28 00:45:03 +00:00
Lucas Mazza
6431445846 Cast the result of deperecated sanitization calls to a HWIA as well. 2015-12-21 09:57:20 -02:00
Lucas Mazza
8d57a54b2d ✂️ Remove custom Travis cache scripts. 2015-12-21 09:46:11 -02:00
Lucas Mazza
280d12b81c Merge pull request #3856 from plataformatec/lm-sanitizer-cleanup
Remove `ParametersSanitizer` inheritance.
2015-12-21 09:40:59 -02:00
Lucas Mazza
00a0b8e516 Fix duplicated exclude entry. 2015-12-20 23:02:52 -02:00
Lucas Mazza
238ccb15b5 Test against the beta Rails release. 2015-12-20 22:56:13 -02:00
Lucas Mazza
ace7b55a1a Merge pull request #3868 from twalpole/gemfile_update
update rails 5 gemfile with compatbile gem releases
2015-12-20 21:03:06 -02:00
Thomas Walpole
97ab41728e update rails 5 gemfile with compatbile gem releases 2015-12-20 12:31:51 -08:00
Lucas Mazza
acd9f84802 Merge pull request #3866 from plataformatec/lm-remove-key-generator
Remove `KeyGenerator` implementation ported from Rails 4.x.
2015-12-18 15:18:15 -02:00
Lucas Mazza
a24ecc65f5 Remove KeyGenerator implementation ported from Rails 4.x. 2015-12-18 14:49:50 -02:00
Lucas Mazza
4e45a5fde4 Remove Rails version mention from the initializer template. 2015-12-18 14:47:32 -02:00
Lucas Mazza
9499736593 Remove safeguard against a previously broken NullSessionHash#reset_session.
This behavior was fixed on https://github.com/rails/rails/pull/12279.
2015-12-18 14:47:32 -02:00
Lucas Mazza
df8b48646b Remove ParametersSanitizer inheritance.
We no longer need to support the `BaseSanitizer` implementation for apps without
the Strong Parameters API, and this section is lacking a minimal set of
docs to document the expected behavior besides the `README` section.
2015-12-18 11:39:03 -02:00
Lucas Mazza
b4904a4ba2 Merge pull request #3865 from djsegal/rails5
Add #3732 helper logic to devise controller
2015-12-18 10:53:14 -02:00
djsegal
2006f87b58 Add #3732 helper logic to devise controller: #3864 2015-12-18 04:05:30 -05:00
Thomas Walpole
5d9f6d892f Explicitly permit rather than using to_unsafe_h 2015-12-16 14:14:15 -08:00
Lucas Mazza
1ac4bdd090 Merge pull request #3857 from twalpole/test_fix
Fix Rails 5 test
2015-12-16 10:01:18 -02:00
Thomas Walpole
302c4e43bd fix Rails 5 test 2015-12-15 10:32:24 -08:00
Lucas Mazza
f5926f6514 Do not send Travis notifications of Pull Requests. 2015-12-15 15:26:08 -02:00
Lucas Mazza
330e0f7165 Update lockfile. 2015-12-15 14:55:36 -02:00
Lucas Mazza
42376db763 Update Devise version on README [ci skip] 2015-12-15 11:52:26 -02:00
Lucas Mazza
1147badf7c Update Rails dependency contrainst to support the stable 5.0.0 release. 2015-12-15 11:49:44 -02:00
Lucas Mazza
7b000390ac Update CHANGELOG.md [ci skip] 2015-12-15 11:48:41 -02:00
Lucas Mazza
dd5de829c9 Merge pull request #3714 from twalpole/rails5
Rails 5 Support
2015-12-15 11:44:01 -02:00
Lucas Mazza
2f7834245b Merge pull request #3835 from kv109/master
test for save in after_create hook breaks devise confirmation [3787]
2015-12-15 11:36:47 -02:00
Lucas Mazza
78d2654fb4 Merge pull request #3793 from chrismacias/save_in_after_create_hook_breaks_devise_confirmation
save in after_create hook breaks devise confirmation
2015-12-15 11:36:34 -02:00
José Valim
934dbd1f5a Merge pull request #3854 from joshsoftware/reset_password_token_issue
Comparing times in UTC
2015-12-15 11:55:24 +01:00
Siva Gollapalli
23933d2fb0 FIX# Comparing times in UTC 2015-12-15 15:17:11 +05:30
José Valim
76bbbb8ed5 Merge pull request #3853 from betesh/betesh-patch-1
Removed unnecessary module fixes #3852
2015-12-15 09:35:12 +01:00
betesh
8701a88c94 Removed unnecessary module 2015-12-15 02:52:17 -05:00
Thomas Walpole
2024fca4df Rails 5 compatability. Remove rails < 4.1 and Ruby < 2.1 2015-12-11 09:47:30 -08:00
Lucas Mazza
032eb145df Release 3.5.3. 2015-12-10 14:36:34 -02:00
José Valim
0d941b7ba5 Merge pull request #3847 from stanhu/reset-token-only-on-update
Only clear the reset token on an update
2015-12-09 20:28:06 +01:00
Stan Hu
f71d843f93 Only clear the reset token on an update
This solves the issue where a package might do:

```
user = User.new
user.email = 'test@test.com'
token = user.generate_reset_token
user.save

send_reset_email(token)
```

Since the save clears the reset token, the user will receive a stale token that no longer works.

Closes #3774
2015-12-09 11:14:50 -08:00
Lucas Mazza
7d825c93b6 Update CHANGELOG [ci skip]. 2015-12-09 13:53:29 -02:00
José Valim
19b1e2a6bc Merge pull request #3846 from seddy/make_email_optional_on_recoverable
Allow resources with no email field to be recoverable
2015-12-09 14:39:32 +01:00
José Valim
901919f25f Revert "Merge pull request #3774 from stanhu/reset-token-only-if-not-persisted"
This reverts commit 15c38d918f, reversing
changes made to 508c3418f9.
2015-12-09 14:21:09 +01:00
Lucas Mazza
15c38d918f Merge pull request #3774 from stanhu/reset-token-only-if-not-persisted
Only clear the reset password token if the model has already been persisted
2015-12-09 10:54:36 -02:00
Lucas Mazza
508c3418f9 Merge pull request #3826 from andygeers/master
Don't error if resource doesn't need confirming
2015-12-09 10:52:35 -02:00
Ed Saunders
d98e98fe77 Add a test for when a recoverable resource has a non-AR email field 2015-12-08 16:01:39 +00:00
Ed Saunders
4a45eb9899 Allow resources with no email field to be recoverable
The current implementation is opinionated about the resource should have
an "email" column on it if it is to be recoverable, which isn't
necessarily the case.  For example, developers may decide to pull emails
out into their own model or have some other way of communicating
password resets to their users (e.g. text message)

I'm not sure there's an easy test to put together for this case, as
minitest doesn't make it very easy to stub the "email_changed?" to raise
an error. Happy to look into building another model in the
"test/rails_app" if you want to have this properly tested though? Or for
a nice way to get calls to "email_changed?" to raise; minitest isn't
a test framework I'm overly familiar with :).

As a side note, it would be nice if the Validatable module also took
this into account, I may raise another PR for that.

This comes off the back of comments on this commit:
e641b4b7b9
2015-12-07 17:01:31 +00:00
José Valim
45fc964470 Merge pull request #3739 from stanhu/support-relative-urls-in-failure-app
Account for relative_url_root in FailureApp's recall method
2015-11-25 20:03:28 +01:00
Stan Hu
56fed052f8 Wrap logic for resetting token into instance method and add comments 2015-11-24 23:23:34 -08:00
Kacper Walanus
a0cd4655ba test for save in after_create hook breaks devise confirmation [3787] 2015-11-24 01:54:03 +01:00
Andy Geers
d3f521925e Write unit test for bug fix 2015-11-18 22:21:03 +00:00
Andy Geers
8a8887ea82 Don't error if resource doesn't need confirming 2015-11-18 22:21:03 +00:00
José Valim
d22ac4a4fb Merge pull request #3813 from jlerpscher/set-minimum-password-length-on-failure
set minimum password length on reset failure
2015-11-10 09:37:59 -02:00
Julien Lerpscher
8426b12550 set minimum password length on reset failure 2015-11-10 12:17:29 +01:00
José Valim
57bf362b55 Merge pull request #3808 from blase/skip-timeoutable
Allow skipping the timeoutable hook
2015-11-04 18:15:03 -02:00
José Valim
18a8260535 Merge pull request #3805 from robuye/master
Remove outdated example from documentation
2015-11-04 00:48:35 -02:00
Błażej Pankowiak
9f32f421a5 Allow skipping the timeoutable hook 2015-11-02 23:53:09 +01:00
robuye
df6a83b27b Remove outdated example from documentation
`#reset_password` always saves the record if validation passes.
2015-11-02 23:06:38 +01:00
Lucas Mazza
4477bab1aa Update Travis CI notification settings. 2015-11-01 19:54:58 -02:00
Christian Macias
54bb30a1a4 changed email_was !='' to email_was.present? 2015-10-26 08:56:14 -07:00
Christian Macias
5ae6360e75 fix for #3787, save in after_create hook breaks devise confirmation 2015-10-22 13:05:02 -07:00
José Valim
d6dc93ca3d Merge pull request #3792 from excid3/master
Automatically underscore and pluralize scoped views generator
2015-10-22 00:42:40 +02:00
Chris Oliver
005d514adf Automatically underscore and pluralize scoped views generator. Fixes #3790 2015-10-21 14:53:03 -04:00
Lucas Mazza
9568e28d66 Merge pull request #3783 from yui-knk/doc_singular_option
[ci skip] Write how to use `singular` option of `ActionDispatch::Rout…
2015-10-19 09:15:34 -04:00
yui-knk
4f2571a408 [ci skip] Write how to use singular option of ActionDispatch::Routing::Mapper#devise_for
* Replace "the instance variable name in controller" with "the helper methods
  names in controller".
  Devise dose not define instance variable for controllers but define helper
  methods for controllers.
* Replace "the name in routes" with "the scope name in routes".
  `singular` is used as an argument of `devise_scope`.
* Add sample codes of routing and controller.
2015-10-16 11:57:42 +09:00
Rafael Mendonça França
e33d285e4a Update the documentation to use current Rails code [ci skip] 2015-10-15 16:13:06 -03:00
Stan Hu
619128cb9b Only clear the reset password token if the model has already been persisted
If a new user is created with a reset password token, the previous behavior
would automatically clear the token even when it was desired for setting
the password for the first time.
2015-10-02 12:30:57 -07:00
George Guimarães
9f37b6eff7 Merge pull request #3769 from xymbol/fix_typos
Fix typos
2015-09-30 19:39:49 -03:00
Adrian Mugnolo
2380612b6e Fix typo: authenticatable 2015-09-30 19:32:44 -03:00
Adrian Mugnolo
c334179c95 Fix typo: successful 2015-09-30 19:31:49 -03:00
José Valim
827d009b3c Merge pull request #3766 from nambrot/patch-1
Add missing comma
2015-09-28 17:28:41 +02:00
Nam Chu Hoai
56edeec958 Add missing comma 2015-09-28 11:25:03 -04:00
Lucas Mazza
7df57d5081 Merge pull request #3732 from posgarou/refactor/respond_to_helper_method
Wrap helper_method calls in respond_to?(:helper_method)
2015-09-26 11:05:30 -03:00
George Guimarães
2ccffc80b0 Merge pull request #3743 from plataformatec/fdf-add-code-of-conduct
Add a Code of Conduct
2015-09-08 00:02:47 -03:00
Flavia Fortes
797a19352c Add a Code of Conduct 2015-09-07 23:59:51 -03:00
Stan Hu
7025f968c6 Account for relative_url_root in FailureApp's recall method
Closes #3738
2015-09-06 00:05:19 -07:00
Ryan Mitchell
04e01f49a9 Use builtin matchers in helper tests 2015-08-31 09:58:25 -04:00
Ryan Mitchell
a3da40a701 Wrap helper_method calls in respond_to?(:helper_method) 2015-08-29 05:29:05 -04:00
Lucas Mazza
40258bf100 Remove the custom OmniAuth camelization on teardown. 2015-08-28 11:26:41 -03:00
Lucas Mazza
d3baff221d Merge pull request #3730 from timoschilling/omin-auth-camelization
use OmniAuth::Utils.camelize
2015-08-28 10:57:20 -03:00
Timo Schilling
f5e984c151 use OmniAuth::Utils.camelize
This will display the provider name with the original camelization:
facebook => Facebook
github => GitHub
linkedin => LinkedIn
2015-08-28 07:51:37 +02:00
Lucas Mazza
6ed6e09bf3 Merge pull request #3642 from jphenow/add-password-change-notification
Add password change notification
2015-08-27 12:48:14 -03:00
Jon Phenow
05ccdfbacd Merge branch 'add-password-change-notification' of github.com:jphenow/devise into add-password-change-notification 2015-08-27 10:43:51 -05:00
Jon Phenow
9bcc2d1c5f CHANGELOG 2015-08-27 10:26:42 -05:00
Jon Phenow
211159f2eb translation for mailer subject 2015-08-27 10:26:12 -05:00
Jon Phenow
ab141a8779 move model stubs 2015-08-27 10:26:12 -05:00
Jon Phenow
e9c82472ff quick comment touch-ups 2015-08-27 10:26:12 -05:00
Jon Phenow
48ed2fd1aa templates, config documentation 2015-08-27 10:26:12 -05:00
Jon Phenow
0fa74d863d functionality 2015-08-27 10:26:12 -05:00
Jon Phenow
c744dcf07a tests 2015-08-27 10:26:12 -05:00
Lucas Mazza
eb091b867f Fix rails g devise:views -v mailer with the Simple Form generator.
Our Simple Form generator shouldn't be responsible for generating the `mailer`
view directory, so we should skip it and let the Erb generator do the job.

Closes #3254.
2015-08-27 12:12:13 -03:00
Lucas Mazza
fb3568308e Merge pull request #3707 from LimeBlast/master
modifys markerb templates to use markdown links, not html ones.
2015-08-27 10:28:02 -03:00
Lucas Mazza
93b8f01583 Merge pull request #3719 from dgynn/doc_api_change
Update docs for Devise::Models.config
2015-08-26 14:56:22 -03:00
Dave Gynn
068da8045b update api docs for Models.config
config no longer takes a default value since 80699c58b4.
also, :streches was moved to DatabaseAuthenticatable.
2015-08-21 00:50:31 -07:00
José Valim
b12658782f Merge pull request #3717 from MarkMT/patch-2
Update comment on Devise.add_module
2015-08-21 09:18:19 +02:00
José Valim
3e87489c5b Merge pull request #3715 from evopark/feature/enhance_failure_app_url_options
Use default_url_options from parent_controller
2015-08-21 09:15:56 +02:00
Marcus Ilgner
8aa0e2655e Use default_url_options from parent_controller
Use a configured Devise.parent_controller, not ApplicationController
Also remove passing `*args` since it's a class-level attribute, not
a method.
2015-08-21 08:32:43 +02:00
MarkMT
155e23a73e Update comment on Devise.add_module
The existing comment suggests that add_module is used only for modules that are not provided by Devise itself.
2015-08-20 19:17:52 -05:00
José Valim
359fba970e Merge pull request #3713 from MarkMT/patch-1
Update comment on Devise.configure_warden
2015-08-19 10:04:31 +02:00
MarkMT
3a056f6d10 Update comment on Devise.configure_warden
The existing comment seems to be either outdated or obscure. I interpret it as meaning that configure_warden! is invoked by an 'initializer' block in class Devise::Engine, i.e. in lib/devise/rails.rb. However, as far as I can tell the only time the method is invoked is when ActionDispatch::Routing::RouteSet#finalize! is called, and this is aliased by devise to finalize_with_devise!.
2015-08-18 22:41:58 -05:00
José Valim
213aa51126 Merge pull request #3708 from dayweek/patch-1
Add removed method to CHANGELOG
2015-08-14 14:12:01 +02:00
David Hrachovy
8588387fad Add removed method to CHANGELOG
my app failed to start because the method was removed. I think it makes sense to mention it here.
2015-08-14 14:02:57 +02:00
Daniel Hollands
8c6de852c6 modifys markerb templates to use markdown links, not html ones. 2015-08-13 13:57:01 +01:00
Carlos Antonio da Silva
52e35f69c5 Fix typo in changelo [ci skip]
Thanks @reedloden.
2015-08-10 20:39:22 -03:00
José Valim
d9939d1ea0 Release v3.5.2 2015-08-10 14:46:36 +02:00
José Valim
703a0e0240 Merge pull request #3678 from OliveTreeBible/dctrotz-basic-auth-patch
Basic auth case insensitive pattern match
2015-08-10 14:14:06 +02:00
José Valim
48d8285344 Merge pull request #3699 from NeilvB/fix-line-break-edit-password
Remove unnecessary line break on edit password page.
2015-08-06 19:53:52 +02:00
Neil van Beinum
710496b6a8 Remove unnecessary line break on edit password page. 2015-08-06 18:21:34 +01:00
José Valim
2f45755e6c Merge pull request #3695 from yakovenkodenis/minor_grammar_improvements_at_readme
Improve grammar on lines 189 and 352 in readme
2015-08-02 13:53:24 +02:00
Denis Yakovenko
021f2da1e4 Improve grammar on lines 189 and 352 in readme 2015-08-02 13:48:31 +03:00
José Valim
bc6361ab9b Merge pull request #3661 from vincentwoo/plain_confirmation
Do not use digests for confirmation tokens
2015-07-30 11:43:10 +02:00
Vincent Woo
eb640ed344 Do not use digests for confirmation tokens 2015-07-30 01:55:50 -07:00
David Trotz
5c244d9e2b Basic auth case insensitive pattern match
Allow basic authentication to be case insensitive as per the HTTP 1.1 spec RFC 2068 Section 11
> It uses an extensible, case-insensitive token to identify the authentication scheme, followed by a comma-separated list of attribute-value pairs which carry the parameters necessary for achieving authentication via that scheme.

We have a particular client in production that has basic auth hard-coded as `basic` rather than `Basic` and devise is rejecting perfectly fine credentials. Making this small change has allowed us to authenticate this client with no issues.
2015-07-16 10:58:59 -07:00
José Valim
e538f02f30 Merge pull request #3672 from deivid-rodriguez/remove_obsolete_unused_config
Remove obsolete unused `expire_auth_token_on_timeout` config
2015-07-11 19:35:29 +02:00
David Rodríguez
4064641967 Remove obsolete expire_auth_token_on_timeout
This should have been removed in dff7891b97
when token authentication (and the reset_authentication_token! method)
were removed.
2015-07-11 09:01:22 -03:00
David Rodríguez
c72be1531c Keep Gemfile.lock in sync
Forgotten in b23f5223dd
2015-07-11 08:57:40 -03:00
José Valim
f0a168da5a Merge pull request #3670 from fengye87/master
redirect to after_resetting_password_path always
2015-07-10 17:32:37 +02:00
Feng Ye
4d89c709a5 redirect to after_resetting_password_path always 2015-07-10 20:01:42 +08:00
José Valim
737a55f9e1 Merge pull request #3659 from abevoelker/fix-auth-route-redirect
Fix infinite redirect in Rails 4.2 authenticated routes. Closes #3643
2015-07-04 11:38:21 +02:00
Carlos Antonio da Silva
fe5b7db6ab Merge pull request #3662 from vincentwoo/fix_mongo_dep
Just use regular 4.x mongoid gem
2015-06-30 22:33:45 -03:00
Vincent Woo
b23f5223dd just use regular 4.x mongoid gem 2015-06-30 16:02:06 -07:00
Abe Voelker
aa675f7f66 Fix infinite redirect in Rails 4.2 authenticated routes. Closes #3643 2015-06-27 14:25:09 -05:00
José Valim
181920886e Merge pull request #3653 from Envek/fix_routes_dynamic_segment_message
Provided another solution in error message when using omniauth callbacks under a dynamic segment
2015-06-24 19:41:28 +02:00
Andrey Novikov
4d8bec435d Provided another solution in error message when using omniauth callbacks under a dynamic segment
Previous solution was too complex and wasn't worked for everyone. See discussion at https://github.com/plataformatec/devise/pull/2227

Fixes #3651 [ci skip]
2015-06-24 20:39:25 +03:00
Jon Phenow
89dbbfd0fd CHANGELOG 2015-06-24 11:13:06 -05:00
Jon Phenow
0164f5862c translation for mailer subject 2015-06-24 11:01:46 -05:00
Jon Phenow
e966ba72b1 move model stubs 2015-06-24 10:50:54 -05:00
Jon Phenow
464edd5e5f quick comment touch-ups 2015-06-24 10:50:43 -05:00
Lucas Mazza
5ba8f36958 Merge pull request #3641 from camelmasa/fix-cve
Update rails gem for security
2015-06-23 11:21:48 -03:00
José Valim
e2041d02e8 Merge pull request #3648 from samdec11/master
Fix default email_regexp config to disallow trailing non-word characters
2015-06-22 16:05:34 +02:00
Sean Marzug-McCarthy
d49533bedc Fix default email_regexp config to disallow trailing non-word characters 2015-06-22 15:41:49 +02:00
José Valim
3dc15c03a7 Merge pull request #3644 from takiy33/patch-1
Remove rubyforge_project option
2015-06-21 11:19:59 +02:00
takiy33
954767d456 Remove rubyforge_project option
rubyforge_project option is deprecated.
2015-06-21 18:12:28 +09:00
Jon Phenow
6c993beb22 templates, config documentation 2015-06-19 14:22:54 -05:00
Jon Phenow
cc9a4e3edc functionality 2015-06-19 14:22:37 -05:00
Jon Phenow
0d59781ea8 tests 2015-06-19 14:21:10 -05:00
camelmasa
1aaf6345a4 Update rails gem for security
See. http://weblog.rubyonrails.org/2015/6/16/Rails-3-2-22-4-1-11-and-4-2-2-have-been-released-and-more/
2015-06-17 15:42:42 +09:00
Carlos Antonio da Silva
15b99977a2 Fix count of starting with rails resources
After 055f67e414. [ci skip]
2015-06-16 07:22:55 -03:00
José Valim
055f67e414 Update README.md
See discussion in #3607
2015-06-15 22:58:25 +02:00
Carlos Antonio da Silva
099aee5c5b Merge pull request #3630 from NAndreasson/fix/autoload-encryptor
Autoload Encryptor
2015-06-12 08:38:24 -03:00
Niklas Andréasson
65dc208ad7 Rm require 'devise/encryptor' in database_authenticable.rb 2015-06-12 13:18:34 +02:00
Niklas Andréasson
e3244b2c31 Autoload Encryptor 2015-06-12 10:36:45 +02:00
Carlos Antonio da Silva
aa49dd53b5 Merge pull request #3627 from vishaldeepak/master
Add codecademy authorization tutorial
2015-06-09 07:32:02 -03:00
VISHAL DEEPAK
916c0fc60b Add codecademy authorization tutorial
A really good , learn by doing, tutorial at codecademy
2015-06-09 15:51:45 +05:30
José Valim
4acb504324 Merge pull request #3616 from yui-knk/refactor/alias
Refactoring `expire_data_after_sign_out!`
2015-06-03 09:01:43 +02:00
yui-knk
3207c73d4b Refactoring expire_data_after_sign_out!
This method is same to `expire_data_after_sign_in!`,
so alias it
2015-06-03 13:14:18 +09:00
Carlos Antonio da Silva
2510c949e5 Merge pull request #3615 from Dbz/fixed_typo
fixed typo referring to routes.rb file
2015-06-02 23:03:51 -03:00
Danny Burt
29e257e8ba fixed typo referring to routes.rb file 2015-06-02 18:10:22 -07:00
José Valim
1a0192201b Merge pull request #3607 from rodrigoargumedo/patch-1
Add GoRails resource into README.md
2015-05-27 09:43:57 +02:00
Rodrigo Argumedo
8db50f4377 Add GoRails resource into README.md 2015-05-26 17:53:10 -06:00
José Valim
42c1ad3c78 Release v3.5.1 2015-05-26 15:10:29 +02:00
José Valim
e641b4b7b9 Also reset password token on email change 2015-05-26 15:09:07 +02:00
José Valim
fe49e625e8 Do not accept empty authentication_salt too 2015-05-26 15:04:27 +02:00
José Valim
31901bc862 Clear up reset password token whenever encrypted password changes 2015-05-26 15:00:12 +02:00
José Valim
b14995167b Do not mark _prefixes as protected 2015-05-26 09:53:38 +02:00
José Valim
4c137c4806 Release v3.5.0 2015-05-23 22:44:49 +02:00
José Valim
e5c3462a62 Merge pull request #3539 from rubyengineer/formatting
Formatting
2015-05-23 22:23:52 +02:00
José Valim
7952f1336d Merge pull request #3541 from cipater/fix-failureapp
Use router_name from scope if available
2015-05-23 22:23:40 +02:00
José Valim
55ef8004e6 Merge pull request #3542 from lboix/patch-1
Adding link to wiki + include clarification
2015-05-23 22:23:09 +02:00
José Valim
4b41dab11b Merge pull request #3601 from Angelmmiguel/master
Allow the user to set the length of friendly token
2015-05-23 22:15:48 +02:00
José Valim
1f3638aaa5 Do not clean up CSRF on rememberable 2015-05-23 22:13:59 +02:00
Angel M de Miguel
db63df7a8f Calculate real characters based on SecureRandom.urlsafe_base64 method 2015-05-21 14:41:34 +02:00
Angel M de Miguel
b89537936b Allow the user to set the length of friendly token 2015-05-21 13:46:31 +02:00
José Valim
ac4a89a511 Merge pull request #3597 from glittershark/define-method-not-class-eval
Use `define_method`, not `class_eval`, for url_helpers
2015-05-12 22:06:59 +02:00
Griffin Smith
741df732dc Use define_method, not class_eval, for url_helpers
I'm not hugely familiar with ruby internals vis a vis sclass semantics,
but this *probably* serves as a workaround for the MRI thread-safety
bug mentioned in #3505.
Beyond that, and even if this doesn't fix the thread-safety issue, per
[this blog post][1], `define_method` is recommended over `class_eval`
for performance (and, fwiw, readability) reasons anyway.

[1]: http://tenderlovemaking.com/2013/03/03/dynamic_method_definitions.html
2015-05-12 15:05:31 -04:00
Carlos Antonio da Silva
d701ed764f Fix wrong comment about http validation method [ci skip] 2015-05-12 14:34:56 -03:00
José Valim
369a5011f8 Merge pull request #3596 from jsanders/confusing-comments-in-generated-controllers
Change comments on registration and session controller configure methods
2015-05-11 20:57:22 +02:00
James Sanders
35de859e28 Change comments on registration and session controller configure methods 2015-05-11 12:12:10 -06:00
José Valim
280c247b2f Merge pull request #3594 from bonobos/feature/split-out-encryptor
Split out BCrypt hashing to make it reusable
2015-05-07 12:26:04 +02:00
Magnus von Koeller
a8769933d1 Split out BCrypt hashing to make it reusable
This logic is generic and reusable -- hash a secret; and take an
unhashed secret and compare it to a hashed secret. This breaks this out
to make it reusable in other places. Specifically, we use this in our
own token auth at Bonobos that we plan to split out as a Devise
extension. This will make that possible without copy & pasting this
code.
2015-05-06 12:11:09 -07:00
José Valim
74679bf3bc Merge pull request #3592 from adacosta/document/confirmable-columns
Add confirmable column documentation
2015-05-06 09:42:59 +02:00
Alan Da Costa
26492b3c50 Add confirmable column documentation 2015-05-05 16:04:15 -07:00
José Valim
a29fee1644 Merge pull request #3575 from alex88/failure_flashes
Conditionally use flashes in failure_app
2015-04-21 19:50:43 +02:00
Alessandro Tagliapietra
eac6c743fd Conditionally use flashes in failure_app
Fixes #3574
2015-04-21 16:27:44 +02:00
José Valim
bc38b044a4 Merge pull request #3573 from kroky/master
improve error message when using omniauth callbacks under a dynamic segment
2015-04-21 12:46:31 +02:00
Victor Emanouilov
85d75702ed improve error message when using omniauth callbacks under a dynamic segment 2015-04-21 13:02:28 +03:00
José Valim
7ca70a47ce Merge pull request #3570 from nviennot/no_more_bang
Removes the bang in confirm! and reset_password!
2015-04-21 10:30:44 +02:00
Nicolas Viennot
c22e7133b6 Removes the bang in confirm! and reset_password!
Closes #3412 and #3570.
2015-04-19 11:47:44 -04:00
Carlos Antonio da Silva
2f0002a449 Simplify serializable_hash implementation
Now that Rails 3.1 is not supported anymore, we don't need to implement
to_xml, since it does the right thing by calling serializable_hash.

This removes the class_eval need that existed to simplify the
implementation of both to_xml and serializable_hash.
2015-03-31 14:11:13 -03:00
cipater
15d3fc497c Use router_name from scope if available
Devise.available_router_name currently returns either
Devise.router_name or :main_app. As such, any redirecting is done
within either of those contexts. Which leads to undesirable redirects
for scopes that reside in an isolate_namespace mounted engine.

This commit makes it possible for FailureApp’s redirect behavior to be
performed in the context of the router_name given to devise_for.

Test case added to cover undesirable behavior. Without change to
lib/devise/failure_app.rb, test case throws exception.
2015-03-30 16:18:05 -07:00
Lucien Boix
e5400bc709 Adding link to wiki + include clarification
Like discussed at the bottom of this ticket : https://github.com/plataformatec/devise/issues/1029
2015-03-29 19:05:24 -04:00
pythogorian
7c309f9b91 Formatting 2015-03-26 23:47:20 +01:00
Carlos Antonio da Silva
79c6f47ad3 Bundle update 2015-03-24 09:00:38 -03:00
José Valim
885597025a Merge pull request #3520 from ianks/valid_password
Valid password
2015-03-17 22:54:40 +01:00
Ian Ker-Seymer
8743ce6cf8 Clearly comment on the functionality of valid_password? 2015-03-17 15:21:59 -06:00
Ian Ker-Seymer
70ab38839f Use password.present? in DatabaseAuthenticatable strategy
In order to be more clear about the expectations of for authenticating, we use
`password.present?` so there is no confusion about the role of the `valid_password?`
method.

More info: https://github.com/plataformatec/devise/issues/3519
2015-03-17 15:19:23 -06:00
Vasiliy Ermolovich
9aa72db365 Remove extra space.
[ci skip]
2015-03-15 02:09:46 +03:00
Carlos Antonio da Silva
18b6064d74 Merge branch 'ca-rm-spaces'
Closes #3480.
2015-03-13 14:00:07 -03:00
Carlos Antonio da Silva
868d3d82a0 Do a final pass removing spaces around square brackets
Keep plataformatec guidelines and review tools happy.
Related to #3480.
2015-03-13 13:59:19 -03:00
Kosmas Chatzimichalis
1ab2d51308 removed spaces inside square brackets 2015-03-13 13:59:19 -03:00
Carlos Antonio da Silva
d1d5996b6b Remove deprecated methods related to token authentication
These methods have no effect since Devise 3.2.0, released in Nov 2013.
2015-03-13 13:54:32 -03:00
José Valim
ef28bf2814 Merge pull request #3504 from scottjacobsen/devise_scope_override
Allow objects to specify their devise scope
2015-03-04 09:27:07 +01:00
Scott Jacobsen
4837bb0a4e Allow objects to specify their devise scope.
Introspecting the scope of an object can make it difficult to use
wrapper patterns. See issue plataformatec/devise#3307 for an example.

Allow objects to specify their scope explicitly by implementing
`devise_scope`.
2015-03-03 22:37:25 -07:00
Carlos Antonio da Silva
b02cd547e2 Merge pull request #3503 from arnvald/remove-redundant-condition
Remove redundant `remember_created_at.nil?`
2015-03-03 13:42:31 -03:00
Grzegorz Witek
8d5c2c4fd9 Remove redundant remember_created_at.nil?
`remember_expired?` already calls this method
2015-03-03 23:51:10 +08:00
José Valim
0a0b4e00ea Merge pull request #3502 from davetron5000/remove-hide-action
remove use of hide_action in favor of protected
2015-03-01 21:48:57 +01:00
Dave Copeland
e1b9dc860f remove use of hide_action in favor of protected
Rails 5 will [not have `hide_action` any longer](https://github.com/rails/rails/pull/18371/files), as the Rails convention is to not expose private or protected methods as actions, thus obviating the need for `hide_action`.

Presumably, there is code inheriting from `DeviseController` that is
calling these helpers, so they cannot be private, so protected seems to
be the only way to get Devise working with Rails 5.
2015-03-01 15:05:20 -05:00
Lauro Caetano
5802a57c76 Merge pull request #3478 from killthekitten/patch-1
Update message after rails g devise:controllers
2015-03-01 16:03:14 -03:00
Lucas Mazza
f038c36161 Use SVG badges in the README. 2015-02-27 14:16:54 -03:00
Rafael Mendonça França
4bb457ff6d Merge pull request #3493 from betesh/master
allow Devise::Models::Authenticatable to be loaded before Rails
2015-02-25 11:46:37 -03:00
Isaac Betesh
ac79f1e114 allow Devise::Models::Authenticatable to be loaded before Rails 2015-02-24 16:29:06 -05:00
José Valim
61ec44b76e Rollback mongoid fix as 4.0.2 will be out soon 2015-02-19 12:13:57 +01:00
Nikolay Shebanov
5e12508b96 Update message after rails g devise:controllers 2015-02-16 19:46:01 +03:00
José Valim
737ae3632a Merge pull request #3473 from georgemillo/test-yield
adding test for RegistrationsController#new yielding the resource
2015-02-14 18:49:59 +01:00
George Millo
a6a1524146 adding test for RegistrationsController#new yielding the resource 2015-02-14 15:37:21 +01:00
José Valim
2992b411a2 Update authenticatable.rb 2015-02-14 11:02:13 +01:00
José Valim
d2658c6e35 Merge pull request #2882 from hauleth/fix-mongoid-10068
Devise + Mongoid store wrong data in session
2015-02-14 11:00:48 +01:00
José Valim
893a0222ef Update new.html.erb 2015-02-14 10:59:01 +01:00
José Valim
fbb7a21abc Merge pull request #3468 from redbar0n/patch-2
Fix potential security leak in email reconfirmation flow
2015-02-14 10:58:25 +01:00
redbar0n
ee8c13435f Fix potential security leak in email reconfirmation flow
Ref. bug/issue: https://github.com/plataformatec/devise/issues/3457
2015-02-13 21:43:06 +01:00
José Valim
c19f1f27ce Merge pull request #3467 from borski/feature/recoverable_autologin_option
Added an option to not automatically sign in a user after a password res...
2015-02-13 13:32:35 +01:00
Michael Borohovski
f0992e4a96 Added an option to not automatically sign in a user after a password reset. This is useful for cases where additional strategies might be needed (such as two-factor authentication, e.g.), or generally if it is considered a security risk to automatically log in a user after a password is reset. 2015-02-13 02:29:11 -08:00
José Valim
baef67cee7 Merge pull request #3452 from jaume-prat/master
workaround for mountable Engines with Rails 4.2
2015-02-13 09:50:30 +01:00
José Valim
00dc3932c6 Merge pull request #3465 from mattbrictson/logging-leaks-readme
Add warning about logged tokens to the README
2015-02-13 09:20:59 +01:00
Matt Brictson
7acc7a6659 Add warning about logged tokens to the README 2015-02-12 16:05:58 -08:00
José Valim
fea2b95c5f Merge pull request #3463 from LunarLogic/master
Extracted route to separate method to be able to override in child class
2015-02-12 13:13:26 +01:00
Ania Slimak
8461234483 Extracted route to separate method to be able to override in child class 2015-02-12 13:07:57 +01:00
Jaume Prat
af8d38e45b do not set :script_name option with nil 2015-02-05 14:33:09 +01:00
Lucas Mazza
a2e0e9c187 Merge pull request #3449 from gaganawhad/patch-1
Add comments re: secret_key on Rails 4+ apps
2015-02-04 19:39:48 -02:00
Gagan Awhad
90f1d4d37a Add helpful comments re: 'secret_key' in devise initializer template
Adding a couple comments that explain that Devise will use
'secret_key_base' on Rails 4+ applications as its 'secret_key' by default.
2015-02-04 14:48:25 -06:00
Lucas Mazza
51c621ef51 Merge pull request #3447 from nitis-intelligence/warning/rails5
removing deprecation warning from rails 5
2015-02-03 19:03:37 -02:00
Luciano Sousa
9177bd70cf removing optional commas 2015-02-02 23:02:52 -03:00
Luciano Sousa
252a57d9b3 removing deprecation warning from rails 5 2015-02-02 22:54:46 -03:00
Lucas Mazza
394d69d958 Merge pull request #3407 from rosenfeld/inherited-controllers-translations
Use Devise translations when inheriting from core controllers
2015-01-26 20:03:11 -02:00
José Valim
65700b22ba Merge pull request #3440 from davestevens/pepper-password
Only add pepper if needed
2015-01-26 19:46:32 +01:00
Dave Stevens
8d48bcd594 Only add pepper if needed
Due to bug in Ruby 2.2.0; The bug has been acknowledged and fixed in trunk.

When password comes in FormEncoded the result of `gsub` breaks when
peppered with `nil`.
This only adds pepper if defined on the model and works around this
bug.

See: 622f3f14b6
2015-01-26 18:06:11 +00:00
José Valim
6dd4444582 Merge pull request #3432 from ronalchn/remember.used.tokens
Keep used confirmation tokens for more user friendly error message (issue #3429)
2015-01-19 13:04:30 +01:00
Ronald Chan
3f95ac8fec Keep used confirmation tokens for more user friendly error message (fixes #3429) 2015-01-19 22:30:13 +13:00
José Valim
c9fb1ebbfe Merge pull request #3428 from erdostom/master
updating copyrights to 2015
2015-01-18 22:38:29 +01:00
Tamas Erdos
bf2b37a39c updating copyrights to 2015 2015-01-18 16:21:59 -05:00
José Valim
8d3e0fddd3 Merge pull request #3425 from kbullaughey/master
get rid of config.serve_static_assets deprecation warning from production.rb
2015-01-16 21:31:38 +01:00
Kevin Bullaughey
1118762ce7 apply the same change to production.rb that was put into test.rb to get rid of the depracation warning related to the config.serve_static_assets -> config.serve_static_files in Rails 4.2.0 2015-01-16 15:29:08 -05:00
Rodrigo Rosenfeld Rosas
7e5d0ac736 Add tests for translation scope being preserved when inheriting a controller
issue #3367
2015-01-12 17:28:02 -02:00
Rodrigo Rosenfeld Rosas
c2fb80d4d9 Use Devise translations when inheriting from core controllers
closes #3367
2015-01-12 17:24:17 -02:00
José Valim
5eb9f18743 Merge pull request #3414 from georgemillo/patch-1
Remove unnecessary local variable from RegistrationsController
2015-01-11 16:35:48 +01:00
George Millo
5bb479052c Remove local variable from RegistrationsController 2015-01-11 15:10:44 +00:00
José Valim
8523801459 Merge pull request #3411 from nviennot/master
Revert "Better error message in case a trackable module can't be saved."
2015-01-10 16:18:30 +01:00
Nicolas Viennot
620478cc5f Revert "Better error message in case a trackable module can't be saved."
This reverts commit 43d0715238.

save() returns false only when validations failed. In this case, validations are
not performed. Therefore save() may never return a falsy value.
If save() fails, the appropriate exception is raised.

With certain ORMs, such as NoBrainer, save() never returns true/false, but
always raise an exception. This commit lift the incompatiblity.
2015-01-10 09:38:43 -05:00
José Valim
710efe557d Merge pull request #3405 from Dinuz/master
Update find_message to accept scope
2015-01-07 23:39:00 +01:00
Massimiliano
6c5323c574 Update devise_controller.rb 2015-01-07 14:46:02 -05:00
Massimiliano
c92ef26b94 Update find_message to accept scope
This should still keep the devise lookup in the case that a customed scope is not passed as option, but if instead the custom scope is passed, then the find_message method will use it.

This is kind of useful, if i don't want overwrite the devise locale, and use different locale files, but keeping still the fallback of my devise locale.
2015-01-06 21:06:09 -05:00
Carlos Antonio da Silva
d6972ab264 Tidy up
* Fix test class name
* No need for line breaks
2015-01-06 14:23:06 -02:00
José Valim
5dc0f8dab9 Merge pull request #3404 from vimutter/rails-initializers-order
Added devise.omniauth initializer explicit position requirements.
2015-01-06 17:15:39 +01:00
Mark Guk
b223ddeb35 Added devise.omniauth initializer explicit position requirements.
It is obvious that this initializer should be executed before Rails build_middleware_stack as Omniauth is build on middleware.
Also it is obvious that we need that initializer to be executed after all config/initializers/* files (that is where devise.rb usually is).
2015-01-06 18:05:38 +03:00
José Valim
1094ba65aa Merge pull request #3400 from eugeneius/test_helper_memoize_warden_per_request
Allow warden proxy to change with request in tests
2015-01-05 09:27:21 +01:00
Eugene Kenny
8d9dd50e4a Allow warden proxy to change with request in tests
The warden method in the Devise::TestHelpers module adds a Warden proxy
object to the request environment hash under the 'warden' key. Including
this module in your test case registers that method as a callback, which
runs before every test:
https://github.com/plataformatec/devise/blob/v3.4.1/lib/devise/test_helpers.rb#L12

The request object itself is created in a callback added by Rails:
https://github.com/rails/rails/blob/v4.2.0/actionpack/lib/action_controller/test_case.rb#L687

So before each test runs, the Rails callback creates the request object,
and then the Devise callback adds a Warden proxy object to it.

I was using the rspec-retry gem (https://github.com/y310/rspec-retry),
and noticed that my controller specs would always fail whenever they
were retried with this error:

NoMethodError: undefined method `authenticate!' for nil:NilClass

When rspec-retry re-runs a failed test, it runs the setup callbacks
again. The Rails callback creates a new request object, but because of
the memoization that was here before, the Devise callback wouldn't add a
Warden proxy to it, which was causing the error.

With this change, the Warden setup code will still only run once as long
as the request object stays the same, but if it changes a new Warden
proxy will be added to the new request object.
2015-01-05 00:34:54 +00:00
José Valim
7946f681a9 Merge pull request #3394 from JuanitoFatas/patch/fix-warning
Suppress test.rb configuration warning for Rails 4.2.
2014-12-31 09:52:21 +01:00
Juanito Fatas
b2a66732cf Suppress test.rb config warning for Rails 4.2. 2014-12-31 11:35:18 +08:00
Carlos Antonio da Silva
71861ab0bf Merge pull request #3389 from JuanitoFatas/patch/travis-ruby-2-2
Test against Ruby 2.2 on Travis.
2014-12-29 09:00:36 -02:00
Juanito Fatas
bb05314c8f Test against Ruby 2.2 on Travis.
* Add 4.2 stable to matrix.
* Exclude test against Ruby 2.2 for Rails 3.2.
2014-12-29 01:03:07 +08:00
Carlos Antonio da Silva
bebf0ecbbe Simplify the logic to display the minimum password length hint
There's no real need to pass 2 variables to the view to figure that out,
we can simply display the message relying on whether or not the
`@minimum_password_length` variable is present.
2014-12-27 11:22:40 -02:00
Carlos Antonio da Silva
5c5200b5d9 Update dependencies with the released 4.2.0 2014-12-27 11:15:08 -02:00
José Valim
5badce5e8e Merge pull request #3372 from Katee/show-min-password-length-on-edit-password
Show minimum password length on edit password
2014-12-17 21:18:48 +01:00
Katee
d0a30d485d Moves minimum_password_length to DeviseController. 2014-12-16 16:14:32 -05:00
Lucas Mazza
2c8e242000 Use Rails 4.2.0.rc3. 2014-12-16 11:03:26 -02:00
Katee
5e12b158d1 Fixes accidentally removed autofocus. 2014-12-15 20:05:46 -05:00
Katee
607bf70674 Shows min password length on edit password view. 2014-12-15 19:52:58 -05:00
José Valim
bf30ddddc0 Merge pull request #3369 from prathamesh-sonpatki/devise-fixes
Fix description of find_or_initialize_with_error methods
2014-12-12 08:21:55 +01:00
Prathamesh Sonpatki
13c2d4e807 Fix description of find_or_initialize_with_error methods
[ci skip]
2014-12-12 09:26:17 +05:30
José Valim
a9d90503e9 Merge pull request #3318 from BrentWheeldon/bugfix/clear-reset-token
Only set token back if password reset fails.
2014-12-02 11:12:12 +01:00
José Valim
c4dfd465d1 Merge pull request #3353 from psgs/readme-update
Improve README.md flow
2014-12-02 11:06:38 +01:00
psgs
0522b1eb46 Improve README.md flow
Improve the way in which the README.md file flows when read.
2014-12-02 11:41:11 +10:00
Brent Wheeldon
cb89e4435c Only set token back if password reset fails.
This prevents the digested version of the token being saved when a reset
is successful.
2014-12-01 17:58:18 -05:00
Lucas Mazza
6fb466eb1e Use Rails 4.2.0.rc1 2014-12-01 10:18:00 -02:00
Vasiliy Ermolovich
9e93b9d700 Merge pull request #3351 from gajon/master
Trivial doc text correction in authenticatable.rb
2014-12-01 10:36:43 +03:00
Jorge Gajon
640dd97149 Trivial doc text correction in authenticatable.rb 2014-11-30 22:56:44 -06:00
José Valim
681094663b Merge pull request #3342 from rubyrider/test_reset_password_token_should_match
ensuse generated token for reset password token is valid
2014-11-25 15:04:31 +01:00
Irfan Ahmed
0e218d8a01 ensuse digested token for reset password token is valid 2014-11-25 18:32:58 +06:00
Rafael Mendonça França
16005ebcfe Merge pull request #3333 from rosenfeld/master
Remove old references to removed remember_across_browsers option
2014-11-21 19:25:46 -02:00
Rodrigo Rosenfeld Rosas
ae00e0bb20 Remove old references to removed remember_across_browsers option 2014-11-21 17:33:58 -02:00
José Valim
d3d9fba201 Merge pull request #3328 from stephenbaldwin/master
Ability to load modules in specific order
2014-11-20 22:39:43 +01:00
Rafael Mendonça França
bb24d18869 Merge pull request #3325 from joshk/patch-2
Use the new build env on Travis
2014-11-20 19:16:20 -02:00
Stephen Baldwin
06e0f8adca Update devise.rb 2014-11-20 16:01:21 -05:00
Stephen Baldwin
a9e87f067a Ability to load modules in specific order
Allow modules to be inserted at set positions
2014-11-20 15:16:46 -05:00
José Valim
840ecb63a2 Merge pull request #3324 from timscott/patch-1
Option to validate upon #confirm!
2014-11-20 10:18:44 +01:00
Tim Scott
e9bf72be6a Use args hash instead of named parameters for confirm! 2014-11-19 18:38:58 -06:00
Tim Scott
3b882dadac Made ensure valid a named param for confirm!, and added a test. 2014-11-19 16:48:35 -06:00
Josh Kalderimis
3015ac458d use built in travis caching
make sure bundle update is run so that the latest gems are used
2014-11-19 17:08:07 -05:00
Josh Kalderimis
4599b57798 remove the relevant Gemfile.lock 2014-11-19 14:54:31 -05:00
Josh Kalderimis
cf53131ed6 there is no rails-head Gemfile 2014-11-19 14:51:42 -05:00
Josh Kalderimis
04561542b1 Use the new build env on Travis
- use the new build env on Travis (sudo: false) (docs coming soon)
  faster vms, more cpu, more ram, faster vm boot time
- remove the custom caching for now as the new setup has a far better network
- add rails-head to the gemfile list as it wasn't there

caching is generally not recommended for libs like Devise as you want to test against the latest gem versions. Caching will use the min requirements available on the system instead of retrieving the latest.

On that note, it is also recommended to remove the Gemfile.lock from the repo. For now I have just 'rm'd it before 'bundle install'
2014-11-19 13:49:55 -05:00
Tim Scott
4ba84eeb27 Option to validate upon #confirm!
Allow to ensure valid upon confirming.
We might want to consider confirmation status in validations. For example, maybe we want to require certain fields upon confirmation, but not at registration.
2014-11-19 12:29:08 -06:00
Lucas Mazza
c54e9863a6 Update Gemfiles. 2014-11-19 15:43:47 -02:00
Lucas Mazza
adc031b214 Update CHANGELOG [ci skip] 2014-11-19 14:26:44 -02:00
José Valim
a76dfd6552 Merge pull request #3319 from lleger/lleger-fix-password-length
Update password length validation to 72 characters max
2014-11-19 10:25:27 +01:00
José Valim
0efd9244bf Merge pull request #3320 from deivid-rodriguez/yield_the_resource_in_registrations_controller_new_action
Yield the resource in RegistrationsController#new
2014-11-19 10:24:44 +01:00
David Rodríguez
1bbcc54026 Yield the resource in RegistrationsController#new 2014-11-19 09:32:51 +01:00
Logan Leger
c7cc91cb65 Update password length validation to 72 characters max
BCrypt has a limit of 72 characters for the password. Anything beyond 72
characters is truncated. This commit updates the validation to limit
passwords to less than 72 characters, keeping within the limitation.
2014-11-18 23:10:01 -06:00
José Valim
e54326c19c Merge pull request #3314 from djpowers/update_omniauth_casing
Update casing of 'OmniAuth' to match that of official OmniAuth documentation
2014-11-14 20:56:30 +01:00
Dave Powers
63ae9701b4 Update casing of 'OmniAuth' to match that of official OmniAuth documentation 2014-11-14 14:45:09 -05:00
Carlos Antonio da Silva
c47ab5e6cf Merge pull request #3310 from djpowers/patch-1
Fix link to Michael Hartl's Rails Tutorial
2014-11-14 08:18:04 -02:00
Dave Powers
9e083c9689 Fix link to Michael Hartl's Rails Tutorial
Update link to go to authentication chapter of latest edition (3rd) of online book
2014-11-13 23:08:42 -05:00
Lucas Mazza
12b5439f84 Merge pull request #3308 from mtarnovan/master
Yield the resource in SessionsController#new
2014-11-12 11:23:07 -02:00
José Valim
c7a135d6ba Merge pull request #3303 from BM5k/callbacks
add Rememerable#after_remembered callback
2014-11-09 10:01:26 -02:00
BM5k
8c3c6ac10f add docs to other callbacks 2014-11-08 16:51:08 -07:00
BM5k
b5713a8ddf add Rememerable#after_remembered callback 2014-11-08 16:39:24 -07:00
BM5k
6f88df3453 add test for after_database_authentication 2014-11-08 16:00:07 -07:00
José Valim
910868785c Merge pull request #3295 from jbourassa/stored_location_fragment
Include URI's fragment in `store_location_for`
2014-11-05 20:06:28 -02:00
José Valim
13e1a8fd8c Merge pull request #3296 from adelevie/fix_comment_typo
Fix small typo in devise_authenticatable.rb
2014-11-05 20:06:04 -02:00
Jimmy Bourassa
5dedd8c4cf Add fragment support for store_location_for 2014-11-05 16:52:40 -05:00
Alan deLevie
09f433691a Fix small typo in devise_authenticatable.rb 2014-11-05 16:51:29 -05:00
Mihai Târnovan
3902e0702c Yield the resource in SessionsController#new 2014-11-05 15:47:10 +02:00
Lucas Mazza
d67388ad98 Merge pull request #3290 from olivierlacan/patch-1
Add release dates to each version in CHANGELOG
2014-11-03 11:02:37 -02:00
Olivier Lacan
2a5ae0200d Add release dates to each version in CHANGELOG
As I've described [here](http://keepachangelog.com), it's quite useful to associate release version numbers with dates to get situated in a change log. 

Hope you find this useful.

PS: While doing this I did notice that a release marked as yanked in the CHANGELOG was not showing up as yanked on RubyGems, hence #3289.
2014-11-03 13:52:03 +01:00
Lucas Mazza
13e07b4b61 Merge pull request #3279 from Sinbadsoft/activesurppot_load_hooks
Add ActiveSupport load hook for DeviseController
2014-11-03 10:07:07 -02:00
Chaker Nakhli
e46a21be16 remove dynamically added method to DeviseController by active support load hook test 2014-10-29 16:14:38 +01:00
Lucas Mazza
e3f794f369 Release 3.4.1 2014-10-29 12:59:33 -02:00
Chaker Nakhli
8a7796aea9 Add ActiveSupport load hook for DeviseController 2014-10-28 13:41:55 +01:00
Lucas Mazza
05d8d81ff4 Update CHANGELOG 2014-10-27 22:58:24 -02:00
Lucas Mazza
a93edc72fd Check for a Hash when using the authentication_keys to generate the FailureApp flash message.
Fixes #3270.
2014-10-27 22:32:19 -02:00
José Valim
b910f5eb83 Merge pull request #3276 from michaelmoulsdale/patch-1
Update README.md - Updated Configuring controllers section
2014-10-26 16:36:01 -02:00
Michael Moulsdale
2c2e366500 Update README.md
Updated decsription of Configuring controllers to use Users rather than Admins. This is purely to be consistent with the previous documentation
2014-10-26 18:33:27 +00:00
José Valim
11060fb8da Merge pull request #3269 from cllns/fix-field-class-on-views
Change views from class="fields" to class="field" to be same as rails scaffolding
2014-10-22 15:39:41 -02:00
Sean Collins
cfe0dc1ee1 change class="fields" to class="field" to be same as rails scaffolding 2014-10-22 12:44:01 -04:00
José Valim
2c0186e090 Merge pull request #3266 from udaysinghcode/fix-issue-3256
Fixed Issue #3256 - View Reformatting
2014-10-22 06:58:14 -02:00
Uday Singh
51263f995b updated confirmation views with the same formatting and added fields and actions to tag 2014-10-22 04:25:33 -04:00
Uday Singh
f9ca733e68 updated passwords views with proper formatting akin to scaffolding and classes for fields and actions 2014-10-22 04:23:51 -04:00
Uday Singh
9c221e2418 updated new.html.erb unlock views 2014-10-22 04:12:28 -04:00
Uday Singh
ef016b448e reformatted and updated sessions views with proper fields and action classes 2014-10-22 04:10:01 -04:00
Uday Singh
a5bab11321 reformatted fields, added fields and actions class like rails scaffolding, changed <i> html tag for updated <em> html5 tag 2014-10-22 04:08:33 -04:00
José Valim
dae49f836a Merge pull request #3263 from gdpelican/feature/localize-confirmable-tests
Localize confirmable tests
2014-10-20 15:08:08 -02:00
James Kiesel
c1864663aa Localize confirmable tests 2014-10-21 02:28:58 +13:00
José Valim
e96c9c961b Merge pull request #3260 from hbriggs/master
allow set_flash_message to set flash.now messages
2014-10-19 14:12:54 -02:00
Rafael Mendonça França
5e58b1abfa Merge pull request #3261 from seuros/patch-1
require ruby 1.9.3+
2014-10-19 13:40:55 -02:00
Abdelkader Boudih
f91dbd1b8b require ruby 1.9.3+ 2014-10-19 15:36:22 +00:00
Hannah Briggs
f80ebea0e6 allow set_flash_message to set flash.now messages 2014-10-18 21:28:20 -07:00
José Valim
2bae9da287 Merge pull request #3259 from janpantel/typo-controller-generator
Fix typo in controller generators help message
2014-10-18 17:39:53 +02:00
Jan Pantel
d6c8aef15f Fix typo in controller generators help message 2014-10-18 17:34:38 +02:00
Lucas Mazza
f246f62b10 Remove CHANGELOG entry since #3195 was reverted. 2014-10-03 14:31:01 -03:00
Lucas Mazza
bdf9c25f3b Release 3.4.0 2014-10-03 14:28:15 -03:00
Lucas Mazza
9b49e89ebd Update CHANGELOG [ci skip] 2014-10-03 14:20:31 -03:00
Lucas Mazza
8e5c098e3a Merge pull request #3153 from plataformatec/lm-rails-4-2
Rails 4.2 compatibility
2014-10-03 14:07:59 -03:00
Lucas Mazza
547e18e24e Merge pull request #3239 from plataformatec/lm-last_attempt_warning
Use the `last_attempt_warning` configuration with the lockable unauthenticated_message message.
2014-10-03 14:04:56 -03:00
José Valim
5ee215bcae Merge pull request #3242 from wasabhi/master
Use spec/rails_helper.rb for rspec-rails config.
2014-10-03 18:59:27 +02:00
Abhinav
6445e07791 Use spec/rails_helper.rb for rspec-rails config. 2014-10-03 10:13:36 -06:00
Lucas Mazza
fa7714218e Update CHANGELOG 2014-10-03 09:49:48 -03:00
Lucas Mazza
6405c96213 last_attempt_warning should be true for now on. 2014-10-03 09:49:29 -03:00
Lucas Mazza
1d8890b773 Merge branch 'master' into lm-rails-4-2 2014-10-03 09:41:23 -03:00
Lucas Mazza
fd565c7efb Merge pull request #3241 from plataformatec/revert-3195-master
Revert "Removes reloading of routes when eager loading ..."
2014-10-03 09:39:09 -03:00
Lucas Mazza
c411ebcad6 Revert "Removes reloading of routes when eager loading ..." 2014-10-03 09:35:05 -03:00
Lucas Mazza
8b15184a25 Use the last_attempt_warning configuration with the lockable unauthenticated_message message.
This configuration was added in #2687 but it was never used in the real code that
defines what message should be used by the app.
2014-10-02 18:50:48 -03:00
Lucas Mazza
ed109ac3d5 Merge swap usage into a single method call. 2014-10-02 18:42:46 -03:00
Lucas Mazza
6f8a383ff6 Merge pull request #3221 from timoschilling/auth_keys_text
fix and optimice authentication_keys
2014-09-29 17:43:13 -03:00
Lucas Mazza
ee69d41fc1 Remove ActiveSupport test order deprecation warning 2014-09-29 17:42:08 -03:00
Lucas Mazza
1ed93cacd8 Update Rails dependency 2014-09-29 17:38:16 -03:00
Lucas Mazza
7eeaac9db1 Merge branch 'master' into lm-rails-4-2 2014-09-29 17:30:30 -03:00
José Valim
64b4905410 Merge pull request #3229 from yandy/patch-1
fix path bug
2014-09-29 09:30:11 +02:00
Michael Ding
002b4c6c01 fix argument bug
when `is_navigational_format?` returns false, Exception will be throw: 
ArgumentError (Nil location provided. Can't build URI.)
2014-09-29 14:36:05 +08:00
Timo Schilling
0f240ab68f code cleanup FailureApp 2014-09-24 15:51:51 +02:00
Timo Schilling
d546665102 use I18n "support.array.words_connector" as connector 2014-09-24 14:13:37 +02:00
Timo Schilling
d3c53904c7 use auth keys from scope instead of global config 2014-09-24 14:05:38 +02:00
José Valim
9f63850279 Merge pull request #3218 from timoschilling/fix_3201
use authentication_keys in flash message (fix #3201)
2014-09-24 08:15:40 +02:00
Timo Schilling
6b0d11ed7a use authentication_keys in flash message, instead of static ‘username’ (fix #3201) 2014-09-23 18:42:11 +02:00
José Valim
258a29636b Merge pull request #3216 from vasinov/master
Update README.md
2014-09-22 09:35:25 +02:00
Vasily Vasinov
c811ea2edb Update README.md
Added the security shield from Hakiri.
2014-09-21 21:41:42 -06:00
Lucas Mazza
dce67416c5 Merge pull request #3162 from plataformatec/lm-sanitizer-to-hash
Do not pass down 'ActionController::Parameters' to outside the controller
2014-09-18 18:45:05 -03:00
Lucas Mazza
c043eca2b2 Silence controller generator warning output 2014-09-18 18:24:26 -03:00
Lucas Mazza
39ed332299 Ensure that we sanitize any AC::Parameters in find_or_initialize_with_errors.
As we are already slicing the Hash, we must be sure that this method will send
 a "safe" object down to the other finder methods that will use the Hash entries
 to do the querying.
2014-09-18 18:21:05 -03:00
Lucas Mazza
8482e485d1 Merge branch 'master' into lm-rails-4-2 2014-09-18 17:46:14 -03:00
Lucas Mazza
952c162bee Update CHANGELOG 2014-09-18 17:25:13 -03:00
Lucas Mazza
131013ac56 Controller templates should have the .rb extension, not .erb. 2014-09-18 17:21:25 -03:00
Lucas Mazza
79a4b93993 Point users to the canonical Omniauth docs in our README, not the wiki. 2014-09-18 17:18:11 -03:00
Lucas Mazza
9fe1561b56 Merge pull request #3169 from Chun-Yang/master
Create controller generator for devise (rails generator devise:controllers users -c sessions)
2014-09-18 17:17:17 -03:00
José Valim
a5158939de Update CHANGELOG 2014-09-18 20:28:24 +02:00
José Valim
7029a5aaa8 Decouple validation from remember_me in authentication strategies
Closes #3118
2014-09-18 20:04:12 +02:00
José Valim
73c406b481 Fix docs for http_authenticatable_on_xhr, closes #3112 2014-09-18 19:50:58 +02:00
José Valim
432a172533 Set null: false explicitly in timestamps 2014-09-18 19:50:58 +02:00
José Valim
1581a34ee4 Merge pull request #3195 from fgro/master
Removes reloading of routes when eager loading ...
2014-09-18 19:44:45 +02:00
José Valim
32b5299547 Merge pull request #3171 from micat/find_scope-should-accept-string
Url helpers raise "undefined method `router_name' for nil:NilClass"
2014-09-18 19:41:49 +02:00
Lucas Mazza
ce6e369ba8 Remove test ordering setup
We can now run the test suite on random order.
2014-09-11 17:41:40 -03:00
Lucas Mazza
8a8e8c6519 Simplify the setup code for the Devise Helper tests so no locales or translations are leaked between tests. 2014-09-11 17:01:07 -03:00
Lucas Mazza
48f03d8cc4 Ensure that the I18n backend is always initialized when we store custom translations.
Depending on the test order, there might a moment when a test reloads the I18n
backend and another tries to store a translation, but since the backend wasn't
re-initialized the custom translations would be overriden when i18n loads the
translations from the en.yml file.
2014-09-11 15:19:41 -03:00
José Valim
13c99d8162 Merge pull request #3205 from pjungwir/consistent-failed-login-messages
All causes of failed login should have the same error message
2014-09-11 17:47:50 +02:00
Paul A. Jungwirth
6e0c287391 All causes of failed login should have the same error message 2014-09-11 08:38:14 -07:00
Chun-Yang
439112adf3 change before_action to before_filter to make it backward compatible to rails 3.2 2014-09-09 20:40:05 -05:00
Chun-Yang
17f6c76dc7 simplify sanitizer in *_params function 2014-09-09 20:35:46 -05:00
Chun-Yang
6003c69818 change indentation 2014-09-09 20:31:48 -05:00
Lucas Mazza
a6f3f8cb4a Split up mailer classes into their own files. 2014-09-08 18:01:39 -03:00
Lucas Mazza
716d128e27 Restore global allow_unconfirmed_access_for after test 2014-09-08 17:38:06 -03:00
Fred Grosskopf
db88341402 Removes reloading of routes when eager loading ...
... is enabled.

The old code may cause conflicts when developing an engine (i.e. invalid
route name) and according to @josevalim the reason for it to remain is
unknown.
2014-09-08 14:21:33 +02:00
Lucas Mazza
cc21c87bb3 Update CHANGELOG [ci skip] 2014-09-03 21:58:44 -05:00
Chun-Yang
67dc138d94 add before_action hooks for registrations and sessions controllers to enable user to add extra params 2014-09-03 00:10:32 -05:00
Chun-Yang
a9095b86d4 fix typo: 'new' action should be 'create' action 2014-09-03 00:02:07 -05:00
Chun-Yang
86ac552287 add *_path_for stubs in all controllers 2014-09-02 23:49:37 -05:00
Chun-Yang
e2e9e90d69 move controller generator info from lib/generators/templates/README to README 2014-09-02 23:25:38 -05:00
Chun-Yang
daad552e1b make scope required 2014-09-02 23:04:27 -05:00
Chun-Yang
2f81a83232 refactor code, use a constant insead of a class variable 2014-09-02 22:54:06 -05:00
Chun-Yang
6ba87ed339 comment out all stubs 2014-09-02 22:34:13 -05:00
Lucas Mazza
c25312e78e Remove ActionMailer/ActiveJob deprecation. 2014-09-02 14:54:28 -03:00
Lucas Mazza
6af18ed9e3 Change the 'postgresql?' check to not connect to the database.
Closes #3181
2014-09-02 11:24:31 -03:00
Carlos Antonio da Silva
930bed7a10 Add changelog for #3175 [ci skip] 2014-09-01 19:38:07 -03:00
Carlos Antonio da Silva
4ad2ed8f12 Merge pull request #3175 from aried3r/update_simple_form_templates
Update Simple Form templates for 3.3.0
2014-09-01 19:34:54 -03:00
Lucas Mazza
13eebb6b76 Ensure that this is only called when necessary. 2014-09-01 19:01:24 -03:00
Lucas Mazza
7dce5baf6c Devise tests are order dependent.
Until 4.2.0, any test suite based on the `TestCase` classes provided by Rails would
always run into alphabetical, but now they run in random order. For now, we ensure
that our tests always run in alphabetical order.

Related commit on rails/rails
6ffb29d24e
2014-09-01 18:47:08 -03:00
Anton Rieder
6117a3b56d Update Simple Form templates for 3.3.0 2014-09-01 21:59:03 +02:00
Chun-Yang
274daad005 fix code example shown in README user will see after running generator 2014-08-27 23:25:48 -05:00
Chun-Yang
316be42ed6 add instruction in the README file for controllers generator. This readme will be printed when user invoke devise:install 2014-08-27 23:20:26 -05:00
Chun-Yang
220c8ff089 print README instruction after running controller generator 2014-08-27 23:19:43 -05:00
Chun-Yang
af47bb5542 update description message in the controllers generator 2014-08-24 22:41:00 -05:00
Chun-Yang
992ee86b41 add test for controllers generator 2014-08-24 22:05:54 -05:00
Chun-Yang
02b1a9c4e0 enable empty scope when generating a controller 2014-08-24 21:28:06 -05:00
micat
7b5293906b Return Symbol in find_scope! if String passed 2014-08-24 21:36:11 +09:00
Chun-Yang
8de94035f0 add better help description 2014-08-24 00:06:12 -05:00
Chun-Yang
d8d9814ed4 user erb template to generate controllers, enable --controllers option to specify controllers, make 'scope' argument required 2014-08-23 23:29:45 -05:00
Chun-Yang
4f77da5b87 Step1: Create controllers templates, and create controller generator to copy ALL templates to rails app directory 2014-08-23 16:44:06 -05:00
Lucas Mazza
2f4fab00d9 Update 4.1 Gemfile 2014-08-22 13:22:00 -03:00
Lucas Mazza
2beae8e143 Update Gemfile list on Travis. 2014-08-20 18:44:50 -03:00
Lucas Mazza
70e9e92d23 Reorganize Gemfiles. 2014-08-20 18:16:51 -03:00
Lucas Mazza
a638c21e76 Add responders as a Devise dependency. 2014-08-20 18:12:57 -03:00
Lucas Mazza
9b9ee8bd2d Test against the released gem 2014-08-19 23:41:51 -03:00
Lucas Mazza
0b13f587ef Update gemfile with latest Rails changes and Responders 2. 2014-08-19 23:39:10 -03:00
Lucas Mazza
0e384f6fb6 Remove missing action warning from the omniauth callbacks route. 2014-08-19 23:38:37 -03:00
Lucas Mazza
7f3dac8652 Use []= instead of merge! to mutate the current Router scope.
This was broken in Rails 4.2.0+ because the `@scope` object is no longer a Hash
but an internal structure that supports a better override/rollback flow for cases
like this. If we would only support Rails 4.2, this method could be something
like this:

```ruby
def with_devise_exclusive_scope(new_path, new_as, options)
  overrides = { as: new_as, path: new_path, module: nil }
  overrides.merge!(options.slice(:constraints, :defaults, :options))

    @scope = @scope.new(overrides)
  yield
ensure
  @scope = @scope.parent
end
```
2014-08-19 23:38:37 -03:00
Lucas Mazza
df43642cd5 Update Gemfiles 2014-08-19 22:14:35 -03:00
Lucas Mazza
8e4a700f81 Update gemfiles 2014-08-18 10:36:57 -03:00
José Valim
871b9b06f8 Merge pull request #3152 from DamirSvrtan/master
Rename links.erb to links.html.erb
2014-08-17 18:38:15 -04:00
Damir Svrtan
df9712bbe4 Rename links.erb to links.html.erb 2014-08-18 00:15:25 +02:00
Lucas Mazza
6e95b66b54 Release v3.3.0 2014-08-13 13:41:14 -03:00
Lucas Mazza
c37552f552 Update CHANGELOG 2014-08-11 17:36:57 -03:00
Lucas Mazza
5d43d5f3bc ✂️ 2014-08-11 17:35:28 -03:00
Lucas Mazza
6207e03070 Merge pull request #3135 from alexsoble/master
UX feature: heads-up for new users about minimum password length
2014-08-11 17:34:41 -03:00
alexsoble
c3fa8fabcf Restore password length message in case of error 2014-08-10 12:17:54 -04:00
alexsoble
fe015f5a54 Revert "Update routes to match 'sign up'/'log in', incorporate feedback from @carlosantoniodasilva"
This reverts commit de2a24b3d3.
2014-08-10 12:13:35 -04:00
alexsoble
de2a24b3d3 Update routes to match 'sign up'/'log in', incorporate feedback from @carlosantoniodasilva 2014-08-07 11:33:03 -04:00
alexsoble
67d8dd1e94 Replace 'Sign in' with 'Log in' in views, update tests 2014-08-06 13:32:02 -04:00
Lucas Mazza
42c3523632 Update Rails git dependencies 2014-08-06 13:40:26 -03:00
Lucas Mazza
6f75fc7a14 Do not mutate the receiving arguments 2014-08-06 13:28:17 -03:00
Lucas Mazza
876644168b remove intermediate Array manipulation 2014-08-06 13:24:29 -03:00
Lucas Mazza
880146668b Update devise_group documentation 2014-08-06 13:24:10 -03:00
Lucas Mazza
086b77ae6d Update CHANGELOG 2014-08-06 13:23:52 -03:00
alexsoble
039b75ba83 Incorporated edits from @lucasmazza, wrote integration tests for password reminder feature 2014-08-06 11:04:46 -04:00
Lucas Mazza
eb9db7ba3a Coerce time objects serialized as Strings before doing the timeoutable comparisons.
The comparison only fails on Ruby 1.9.3, when we need to parse it properly back
to a Time instance.

Related to #2930.
2014-08-05 14:58:27 -03:00
alexsoble
e65c26e1e7 Only display password length warning if validatable module is included 2014-08-05 10:22:47 -04:00
alexsoble
c38accd648 Tell new signups about minimum password length in registrations/new.html.erb 2014-08-04 15:53:40 -04:00
Lucas Mazza
447b7030f8 Work around I18n recent failures. 2014-07-29 18:27:34 -03:00
Lucas Mazza
3cd6e650ef 'eval_block' shouldn't be used since it is a private API.
This method was made private on Rails master @ d2d3376903
2014-07-29 18:22:42 -03:00
Lucas Mazza
8a4fd04436 Update dependencies 2014-07-29 15:58:15 -03:00
José Valim
66db52ce31 Merge pull request #3113 from jherdman/patch-1
Silence Warning Regarding Use of Splat
2014-07-11 21:09:36 +02:00
James Herdman
b64f165154 Silence Warning Regarding Use of Splat
I was seeing the following in my console:

```
/home/vagrant/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/devise-3.2.4/app/controllers/devise_controller.rb:9: warning: `*' interpreted as argument prefix
/home/vagrant/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/devise-3.2.4/app/controllers/devise_controller.rb:10: warning: `*' interpreted as argument prefix
```

This change silences this warning.
2014-07-11 15:06:56 -04:00
Carlos Antonio da Silva
1d803dd23b Get rid of extra module for group helpers
Just use the existing ClassMethods module which is properly extended
with AS::Concern.
2014-07-10 17:01:26 -03:00
Carlos Antonio da Silva
f1d57d7791 Use a different mapping name for testing the omniauth callback failure
This leaks into Devise mappings overriding the existing :admin one, so
depending on the test seed it fails like this:

    $ TESTOPTS="--seed=9972" rake

    ==> Devise.orm = :active_record
    Run options: --seed=9972

    ...

      1) Failure:
      MappingTest#test_allows_path_to_be_given [./test/mapping_test.rb:31]:
      Expected: "admin_area"
        Actual: "admin"

Using a different name should avoid any test randomization issues.
2014-07-10 08:58:21 -03:00
Carlos Antonio da Silva
da01235a20 Fix test that checks for proper configuration of omniauth callback
Previously the test was raising an ArgumentError by mistake:

    ArgumentError: wrong number of arguments (0 for 1)
        actionpack (4.1.4) lib/action_dispatch/routing/route_set.rb:328:in `eval_block'`

The #eval_block method expects a proc/lambda argument that can be
instance_exec'ed, not a real block. In the Rails implementation the block
is passed to #draw, which calls #eval_block internally passing the block
along, but as a Proc argument and not as a block.

Also the error we were raising from #devise_for was a RuntimeError,
changed to the expected ArgumentError. Adding an assertion on top of the
expected message should ensure we won't have this issue again.

This was introduced in 29da146c07, related
to #2802.
2014-07-10 08:53:18 -03:00
Carlos Antonio da Silva
57d7a75b65 Use Devise's swap mechanism in failure app test
Also refactor tests to remove the custom failure app class only used
once in favor of an inline class for the specific test, makes it easier
to follow what's going on.
2014-07-10 08:53:18 -03:00
Carlos Antonio da Silva
2e8aecdac2 Create an anonymous class to test the failure app
No need to have a named class inside the test.
2014-07-10 08:13:06 -03:00
Vasiliy Ermolovich
9938a5e933 add documentation about skip: :all option to devise_for method 2014-07-06 16:35:51 +03:00
Lucas Mazza
9a5783ade3 Update Rails dependency across all lockfiles 2014-07-03 11:50:46 -03:00
Lucas Mazza
50679e1d93 Update Rails version across all the Gemfiles 2014-06-26 20:17:16 -03:00
Lucas Mazza
b6af1675d5 Merge pull request #3082 from greysteil/update-travis
Update Travis config to test on ruby 2.1.2 instead of 2.1.1
2014-06-24 10:23:48 -03:00
Lucas Mazza
520dfe2eb4 Update the overall dependencies and test with mongoid 4.0.0 for now on. 2014-06-24 10:22:26 -03:00
Lucas Mazza
8df6980c9e Update _prefixes override to work with Rails 4.2 2014-06-24 10:06:45 -03:00
José Valim
6f7cd1332b Merge pull request #3083 from jjb/patch-1
changelog detail for expire_all_remember_me_on_sign_out
2014-06-21 10:21:38 +02:00
John Bachir
8c7f6bd2aa changelog detail for expire_all_remember_me_on_sign_out
explain that it's the configurability and not the functionality which is new
2014-06-20 18:01:35 -04:00
Grey Baker
89629e68c9 Update Travis config to test on ruby 2.1.2 instead of 2.1.1 2014-06-20 14:31:15 +01:00
José Valim
f0738098f0 Merge pull request #3079 from Yenwod/add-setup-detail
Add migration setup detail to README
2014-06-19 21:21:17 +02:00
Chris Downey
9abee354f7 Add migration setup detail to README 2014-06-19 15:03:19 -04:00
José Valim
382492ce40 Merge pull request #3077 from ShepBook/minor-readme-grammar
Make minor changes to readme grammar.
2014-06-19 10:49:31 +02:00
Jared Koumentis
d0cb629f81 Make minor changes to readme grammar. 2014-06-19 00:31:37 -04:00
Rafael Mendonça França
a11f54151b Merge pull request #3074 from adamniedzielski/remove-cancan-from-readme
Outdated reference to CanCan in README
2014-06-18 11:11:10 -03:00
Adam Niedzielski
a0b97f5b5d Update README.md
Remove reference to CanCan - it is no longer maintained
2014-06-18 16:03:39 +02:00
José Valim
83c01142a7 Merge pull request #3072 from roryokane/patch-1
Fix grammar and capitalization errors in README
2014-06-16 20:55:49 +02:00
Rory O’Kane
47ba796c26 Fix grammar and capitalization errors in README 2014-06-16 13:43:55 -04:00
José Valim
eeb6060d9d Merge pull request #3054 from cheerfulstoic/devise-neo4j
Changes to support devise-neo4j
2014-06-06 21:08:28 +02:00
José Valim
301539378e Merge pull request #3060 from thomasdarde/patch-1
Update README.md
2014-06-06 21:00:22 +02:00
Thomas Darde
cb48c9c408 Update README.md
Add more description on the way I18n.locale has to be set in case of multi-locale app.
2014-06-06 18:39:06 +02:00
Brian Underwood
74f4442319 User Model.to_adapter directly as suggested by @josevalim 2014-06-06 08:35:42 -07:00
José Valim
2bde395840 Update activatable.rb 2014-06-06 13:03:53 +02:00
José Valim
8b3b3d7955 Merge pull request #3042 from dropletzz/group_helpers
Helper methods for groups of mappings
2014-06-06 12:58:44 +02:00
Brian Underwood
2174e4675e Use User and Admin orm_adapter adapter in tests to support other ORMs (neo4j, in this case) 2014-06-04 21:59:30 -07:00
Lucas Mazza
40068c4cba Merge pull request #3048 from shanab/master
Update README.md
2014-05-29 10:13:10 -03:00
Ahmed Mostafa
37e05380d1 Update README.md
Fixed incorrect method definition.
2014-05-29 16:08:29 +03:00
Brian Underwood
65d7d1ba55 Change test to use acts_like? so that we can have DateTime fields 2014-05-28 22:17:07 -07:00
Giovanni Caniato
dfcb342a8f group methods defined in the current scope 2014-05-28 19:30:03 +02:00
Lucas Mazza
88efa6545f Swap the failure app during the test case properly. 2014-05-28 12:07:25 -03:00
Giovanni Caniato
cb1d6c4684 moved helpers definition from routes to controllers 2014-05-27 11:58:55 +02:00
Giovanni Caniato
8df6a2f38b added groups with their helper methods 2014-05-26 16:45:18 +02:00
José Valim
395b5c4237 Merge pull request #3011 from dwhenry/make-devise-more-engine-friendly
Make devise more engine friendly
2014-05-24 20:20:03 +09:00
Lucas Mazza
08d8591dfd Merge pull request #3038 from kushkella/non-bang-method-trackable
added non-bang version of update_tracked_fields
2014-05-24 00:58:06 -03:00
Lucas Mazza
09db3c65ec Merge pull request #3041 from brentkearney/master
Getting Started instructions: clarification on dynamic method names
2014-05-24 00:40:01 -03:00
Brent Kearney
82b60fce15 Changed MODEL to model, as per request. 2014-05-23 15:15:41 -06:00
Brent Kearney
0e14ac3aa7 Updated Getting Started instructions to help avoid confusion around alternate devise MODEL names 2014-05-23 12:26:19 -06:00
Kush Kella
dd56dc7da6 added test for update_tracked_fields method 2014-05-22 11:11:13 -07:00
José Valim
9818038a72 Merge pull request #3029 from randoum/master
lock_access! better failure message
2014-05-22 10:20:41 +02:00
José Valim
6a783c9ec7 Merge pull request #3023 from jphenow/omniauth-cant-cleanup-csrf
Omniauth can't cleanup CSRF
2014-05-22 10:17:48 +02:00
Kush Kella
451be888cb added non-bang version of update_tracked_fields 2014-05-21 16:18:35 -07:00
Jimmy Chen
72f5eae391 Document that we can configure Devise test helpers in spec_helper.rb
Closes #3006 [ci skip]
2014-05-21 20:07:07 -03:00
randoum
4ee2402cd7 lock_access! better failure message 2014-05-16 06:02:11 +08:00
randoum
d8ee3e49cb lock_access! better failure message 2014-05-16 05:57:18 +08:00
David Henry
6a628724ea Ensure I don't leave public methods around that break the test suit.. 2014-05-15 19:42:08 +01:00
David Henry
c5c360cdd9 Add classes for mongoid based tests 2014-05-15 18:59:51 +01:00
Jon Phenow
d47c370916 * Allows CSRF cleanup to be turned off for certain strategy types
* Defaults Authenticatable CSRF cleanup
2014-05-15 09:16:31 -05:00
Lucas Mazza
2f6edfd0c5 Update dependencies. 2014-05-14 23:41:29 -03:00
Lucas Mazza
fa36464268 Silence the OmniAuth logger during tests. 2014-05-14 23:25:29 -03:00
Lauro Caetano
b51c3c1911 Merge pull request #3024 from diegosouzapb/master
Update README.md
2014-05-11 01:30:19 -03:00
Diego Souza Rodrigues
d1a9f220a1 Update README.md
The old Michael Hartl's online book link was broken. I guess this link is its substitute.
2014-05-11 01:11:48 -03:00
David Henry
426560a4db Attempt without adding engine to application 2014-05-08 00:46:19 +01:00
Carlos Antonio da Silva
6129215afe Simplify test that verifies multiple warden blocks 2014-05-07 18:53:09 -03:00
Carlos Antonio da Silva
916e1d8da9 No need for instance vars on these tests 2014-05-07 18:50:50 -03:00
Carlos Antonio da Silva
1e8a387f34 Merge pull request #3020 from adrpac/master
Fix Rails 4 detection
2014-05-07 17:22:33 -03:00
Adrian Pacała
a2376d6ca1 Fix Rails 4 detection 2014-05-07 22:17:40 +02:00
José Valim
f611b63069 Merge pull request #3017 from adrpac/master
Use inet column type when generating migrations under PostgreSQL
2014-05-07 10:08:39 +02:00
Adrian Pacała
fa1a864731 Generate inet columns for Rails 4 only 2014-05-07 09:18:10 +02:00
Adrian Pacała
53504f7e28 Generate inet columns for postgresql 2014-05-07 08:50:21 +02:00
David Henry
c7099ac5b0 Merge branch 'master' of github.com:plataformatec/devise into make-devise-more-engine-friendly
Conflicts:
	.travis.yml
	Gemfile.lock
2014-05-07 00:22:16 +01:00
David Henry
bec913fc07 Clean up the code. 2014-05-06 23:31:59 +01:00
David Henry
b5da4e82d0 Add full tests around confirmation when using devise_for with router_name 2014-05-06 23:07:24 +01:00
David Henry
ceafc710ef Start adding tests to the engine routing tests. 2014-05-06 00:56:58 +01:00
David Henry
2d3ca4dc31 get everything working with the engine included and devise routes declared within it. 2014-05-05 23:50:26 +01:00
David Henry
18da4b1eff Stash as test have broken 2014-05-05 23:23:55 +01:00
David Henry
1e8e8516f0 Simplify access to router_name using the existing scope lookup. 2014-05-05 23:19:03 +01:00
Lucas Mazza
a51036196a Merge pull request #3013 from aditya-kapoor/split-send_reset_password_instructions
Split send_reset_password_instructions for better hooking
2014-05-05 17:45:09 -03:00
aditya-kapoor
2fc25a8c68 rename method + remove extra db call 2014-05-06 01:23:55 +05:30
aditya-kapoor
c8fcbde2af split send_reset_password_instructions into two parts for better hooking 2014-05-05 13:41:08 +05:30
Lucas Mazza
a3fc587c24 Update Travis config to test on ruby 2.1.1 instead of 2.1.0 2014-05-04 22:45:07 -03:00
Lucas Mazza
3014bcbc45 Update Rails HEAD Gemfile dependencies. 2014-05-04 21:36:38 -03:00
Lucas Mazza
4110ab3228 Update 4-0-stable Gemfile dependencies. 2014-05-04 21:30:06 -03:00
Lucas Mazza
303145c8b7 Update 3-2-stable Gemfile dependencies. 2014-05-04 21:28:01 -03:00
Lucas Mazza
7bab20e55e Update main Gemfile dependencies. 2014-05-04 21:21:45 -03:00
David Henry
33873426ad Use 2.1 instead of 2.1.0
travis-ci/travis-ci#2220
2014-05-04 22:59:29 +01:00
David Henry
3e8fce5081 Make sure I include the new class into the gem 2014-05-04 12:53:25 +01:00
David Henry
d875c01bc2 Extract routing context to its own file. 2014-05-03 23:22:00 +01:00
David Henry
feff27aaee Add description around the new method. 2014-05-03 22:47:27 +01:00
David Henry
1dd84a8244 Don't couple the routing object to the whole system.. pass around the RoutingDetails object instead.
NOTE: RoutingDetails is supposed to be a simple data transfer object.
2014-05-03 22:46:04 +01:00
David Henry
2dee54bc86 make the find_mapping! method return a mapping object 2014-05-03 22:41:32 +01:00
David Henry
23761aded2 Add find_mapping! method to return the router_name instead of overloading find_scope! 2014-05-03 22:37:21 +01:00
David Henry
e085526b6e Get the logic in the right order and fix variable naming (and run the tests) 2014-05-02 00:22:20 +01:00
David Henry
38b347ac00 Fix bug in the tests 2014-05-02 00:17:17 +01:00
David Henry
9e8371c293 Make after_sign_out_path_for and after_inactive_sign_up_path_for aware of router name if declared in devise_for declaration. 2014-05-01 23:49:46 +01:00
David Henry
da49ed23f9 Start adding code to allow devise_for to specify the engine context (router_name) to be used. 2014-05-01 23:39:05 +01:00
José Valim
873e57e97d Merge pull request #3008 from weih/update-legacy-comment
Update legacy comment [ci skip]
2014-05-01 14:19:08 +02:00
Hao Wei
11c8875479 Update legacy comment 2014-05-01 19:49:37 +08:00
Lucas Mazza
1ad09f9cfc Improve CHANGELOG and move assignment to outside the if statement. 2014-04-28 11:28:48 -03:00
Lucas Mazza
13a8ad81ee Merge pull request #2997 from parallel588/master
fixed store location with bad URL
2014-04-28 11:26:56 -03:00
Lucas Mazza
b4c06d1ded Merge pull request #3004 from kento1218/topic/confirmation-success-redirect
Fix Devise::ConfirmationsController#after_confirmation_path_for
2014-04-28 10:56:31 -03:00
kento1218
d63b6b7b9d Fix Devise::ConfirmationsController#after_confirmation_path_for
after_confirmation_path_for checks whether the user already signed in
by calling signed_in? after confirmation succeeded.
Since it was called without scope specification, the user treated as
signed in inappropriately when the user signed in as another resource
(such as 'admin').
2014-04-28 20:44:00 +09:00
Lauro Caetano
1fbc165b98 Merge pull request #3001 from daniely/patch-1
Update README.md
2014-04-27 01:17:55 -03:00
daniely
9cafe0dff6 Update README.md
Correct grammar from "on progress" to "in progress"
2014-04-27 10:25:16 +08:00
Maxim Pechnikov
a841e6c4f0 fixed storing location with bad URL 2014-04-25 19:14:32 +04:00
José Valim
24327c7310 Merge pull request #2990 from westonplatter/master
remove new line to keep convention with other methods
2014-04-20 22:55:48 +02:00
Weston Platter
0b096c961a remove new line to keep convention with other methods 2014-04-20 13:57:31 -06:00
José Valim
0a27a0da3b Merge pull request #2985 from crismali/present-over-not-blank
Switched all instances of 'not blank?' to 'present?'
2014-04-18 08:41:02 +02:00
Michael Crismali
f37b10ef87 Switched all instances of 'not blank?' to 'present?' 2014-04-17 20:34:28 -05:00
Rafael Mendonça França
081ea9e0ba Add CHANGELOG entry for #2978 [ci skip] 2014-04-15 18:47:16 -03:00
Rafael Mendonça França
f60892be23 Merge pull request #2978 from rossta/support_for_multiple_warden_config_blocks
Support multiple warden configuration blocks
2014-04-15 18:46:28 -03:00
Ross Kaffenberger
5f32cd25fd support multiple warden configuration blocks
Changes the behavior of `Devise.warden` such that calling it multiple
times with different blocks will result in a call to each block on
`Devise.configure_warden!` rather than "last block wins". This is
especially used for plugins that wish to extend warden functionality
without clobbering base app configuration or vice versa.
2014-04-15 17:20:21 -04:00
Lucas Mazza
38e868dc79 Update Travis encrypted keys 2014-04-09 19:24:25 -03:00
Lucas Mazza
67613117aa Merge pull request #2955 from lucasmazza/lm-cached-bundle
Cache bundle results on Travis to S3
2014-04-09 19:21:29 -03:00
José Valim
61c497d173 Merge pull request #2968 from plataformatec/sign_out_not_logged_in_user
Check if there is a logged user before logout.
2014-04-09 18:17:06 +02:00
Lauro Caetano
571dead19b Check if there is a signed in user before sign out.
Only execute the `SessionsController#destroy` if there is a signed in
user, otherwise it will raise
`ActionController::InvalidAuthenticityToken`.

Fixes #2934.
2014-04-09 10:25:44 -03:00
Lucas Mazza
b0b18fb805 Merge pull request #2965 from sadjow/use-port-option-on-default-url-options
Use port option in default url options for ActionMailer
2014-04-04 21:14:04 -03:00
Lucas Mazza
5c57d88505 Cache bundle results on Travis to S3 2014-04-04 20:22:39 -03:00
Sadjow Leão
a2bd5631da Use port option in default url options for ActionMailer 2014-04-04 19:01:12 -03:00
José Valim
6466d5c517 Merge pull request #2964 from plataformatec/invalidate_all_sessions_on_logout
Add configuration to invalidate all the remember me tokens when the user signs out.
2014-04-04 21:28:22 +02:00
Lauro Caetano
f7fdde1ab0 Add the invalidate_all_sessions_on_logout configuration to invalidate
all the remember me tokens when the user signs out.
2014-04-04 16:17:26 -03:00
José Valim
947169e4f5 Merge pull request #2960 from kgiszczak/redirect-url-tweaks
Use full urls instead of just paths when redirecting in failure app.
2014-04-04 17:41:41 +02:00
Kamil Giszczak
9cada8d2d4 Use scope instead of constraints to define routes.
It works the same with rails 3 and rails 4.
2014-04-04 16:07:37 +02:00
José Valim
314f731a66 Update CHANGELOG 2014-04-04 09:50:13 +02:00
José Valim
b786c384d5 Remove need for raw session inspect 2014-04-03 21:00:12 +02:00
Lucas Mazza
6027787930 Merge pull request #2954 from plataformatec/lm-last-request-at-json-serialization
Serialize the `last_request_at` entry as an Integer
2014-04-02 22:58:14 -03:00
Kamil Giszczak
a38f2f96b5 Use _url routes instead of _path 2014-04-02 15:42:41 +02:00
José Valim
d019e1ed1a Merge pull request #2958 from karlentwistle/master
Find a resource based off its encrypted reset_password_token
2014-03-31 19:16:20 +02:00
Karl Entwistle
58b311a93f Use the ORM Adapter API 2014-03-31 15:24:55 +01:00
Karl Entwistle
de57ef83fb Find a resource based off its encrypted reset_password_token 2014-03-31 14:58:52 +01:00
Lucas Mazza
145ce9e1de Merge pull request #2956 from Yasserius/patch-1
before_filter turned into before_action
2014-03-29 16:01:54 -03:00
Yasserius
7adf95b945 before_filter turned into before_action 2014-03-30 00:52:00 +06:00
Lucas Mazza
71d8dd37bb Update mongoid dependency. 2014-03-28 23:11:53 -03:00
Lucas Mazza
da0c27393f Serialize the last_request_at entry as an Integer
Pushing the `Time` object inside the session has inconsistencies
across different serializers and we should use a more primitive type
so we don't need any specific parsing logic for the JSON serializer.
2014-03-28 22:51:56 -03:00
Lucas Mazza
f19e82021f Add some spaces around the curly brackets. 2014-03-28 20:53:50 -03:00
Lucas Mazza
3d0559bc4d Merge pull request #2953 from jbnunn/README_ConfiguredParams
Fixed documentation for configured_permitted_parameters
2014-03-28 20:51:36 -03:00
J. Nunn
739c187e81 Fixed documentation for configured_permitted_parameters 2014-03-28 17:21:50 -05:00
Vasiliy Ermolovich
937ed6291c Merge pull request #2946 from naveda89/patch-1
Fixed path syntax error on README.md
2014-03-25 16:46:06 +02:00
Alvaro Naveda
aa456c9d07 Fixed path syntax error on README.md
Minor fix on the configuring controllers section.
2014-03-25 15:43:46 +01:00
José Valim
5b49bd3450 Improve docs for update_with_password
Closes #2942
2014-03-24 21:49:48 +01:00
José Valim
da34c54093 Merge pull request #2937 from dpehrson/registrations-controller-failure-yield
Ensure registration controller block yields happen on failure in addition to success
2014-03-24 18:58:29 +09:00
Daniel Pehrson
90e55409e1 Upgrade stray legacy hash syntax to 1.9 syntax. 2014-03-21 15:24:25 -04:00
Daniel Pehrson
ce3ead6b5f Ensure registration controller block yields happen on failure in addition to success and closes #2936.
Now with 100% more unit tests.
2014-03-21 10:29:14 -04:00
Lucas Mazza
d439bc409c Fix typo on CHANGELOG 2014-03-17 12:11:01 -03:00
Lucas Mazza
8d7a72326a Add a note about #2906 to the CHANGELOG. 2014-03-17 12:10:44 -03:00
Lucas Mazza
59cd0cc240 Merge pull request #2906 from p-originate/master
Grammar/content fixes for email confirmation language
2014-03-17 12:08:07 -03:00
Lucas Mazza
1eab594895 SessionsController#destroy no longer yields the resource object.
If you need access to the current resource when overring the action
use the scope helper (like `current_user`) before calling `super`.

Closes #2926.
2014-03-17 11:52:20 -03:00
Lucas Mazza
755219ccfc Release v3.2.4 2014-03-17 11:16:38 -03:00
Lucas Mazza
9044631f4c Merge pull request #2933 from weimeng/update-changel
Update CHANGELOG.md with missing 2.1.x minor versions
2014-03-17 10:59:33 -03:00
Wei-Meng Lee
a05d001c41 Update CHANGELOG.md with missing 2.1.x minor versions
Changelog for missing entries taken from https://github.com/plataformatec/devise/blob/v2.1.4/CHANGELOG.rdoc
2014-03-17 15:18:44 +08:00
Łukasz Niemier
4064155312 Small refactoring 2014-03-15 16:13:57 +01:00
Lucas Mazza
a8e1d42097 Bump mocha. 2014-03-12 14:40:11 -03:00
Lucas Mazza
0df786c849 Add README docs and a CHANGELOG entry for #2916 2014-03-09 20:54:41 -03:00
Lucas Mazza
ccfe389be1 Merge pull request #2916 from kayline/master
Add ability to generate only specified view directories
2014-03-09 20:49:27 -03:00
Molly Trombley-McCann and Shatarupa Nandi
a79e0f6bca Rename variable to views, change flag to -v 2014-03-06 13:41:11 -08:00
Molly Trombley-McCann
3640abc933 add description to view generator flag 2014-03-04 15:08:46 -08:00
Molly Trombley-McCann
09ebe833b3 Add a flag to views generator allowing user to specify which view directories to generate 2014-03-04 15:05:16 -08:00
Molly Trombley-McCann
4a0bc7692a Add a flag to views generator allowing user to specify which view directories to generate 2014-03-04 14:47:19 -08:00
Greg Cobb and Molly Trombley-McCann
0d06ed6c79 WIP 2014-03-03 09:30:00 -08:00
Oleg Pudeyev
47845e44a2 Chase language changes in tests 2014-03-03 10:15:33 -05:00
José Valim
71eb6176c3 Merge pull request #2913 from petervandenabeele/master
Note that the cost of bcrypt grows dramatically with number of stretches
2014-03-02 20:30:08 +01:00
Peter Vandenabeele
7e6dd5022b Clarify that this stretch behavior is for bcrypt
* other encryptors show a different behavior regarding the
  number of stretches
2014-03-02 20:23:57 +01:00
Peter Vandenabeele
286eefa9b4 Note that the cost of bcrypt grows dramatically with number of stretches
* this will avoid people (like me) loosing an hour trying to understand
  why doing it "a little bit safer" with 20 stretches suddenly takes
  60 seconds to do sign_up or sign_in. An example of such discussion is:
  http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/399627
2014-03-02 18:57:32 +01:00
José Valim
5e00be4af8 Merge pull request #2912 from petervandenabeele/master
Fix typo in initializer template comment
2014-03-02 16:17:14 +01:00
Peter Vandenabeele
a89af190e2 Fix typo in initializer template comment 2014-03-02 15:22:59 +01:00
Oleg Pudeyev
dbddce6acd Missed some "instructions about" -> for 2014-02-28 15:12:07 -05:00
Oleg Pudeyev
1a87fd6477 All other text does not use camel case 2014-02-28 02:04:35 -05:00
Oleg Pudeyev
00af1481f8 Grammar/content fixes for email confirmation language
- account -> email address
- was -> has been
2014-02-28 02:04:23 -05:00
Lucas Mazza
aea82d0b03 Update remaning 1.8 hash syntax. 2014-02-25 14:25:55 -03:00
José Valim
3d9dea39b2 Merge pull request #2899 from justanshulsharma/master
Updated ruby 1.9 hash syntax
2014-02-25 18:03:16 +01:00
Anshul Sharma
dc1b399a8b Updated ruby 1.9 hash syntax 2014-02-25 22:12:55 +05:30
José Valim
a5ad61c167 Merge pull request #2884 from dlackty/fix-secret-token-not-found
Set default secret_key before eager load
2014-02-25 17:36:19 +01:00
Richard Lee
146a2e500e Set default secret_key before eager load 2014-02-25 17:56:34 +08:00
Łukasz Niemier
2c5126dc42 Temporary, and ugly hack. But works now 2014-02-23 21:19:53 +01:00
Łukasz Niemier
a05548110f Should fix #2882 2014-02-23 20:43:16 +01:00
Lauro Caetano
4995d3c221 Merge pull request #2880 from dwbutler/issue_2875
Fix for #2875
2014-02-22 20:53:28 -03:00
David Butler
1987ffc171 Fix for #2875 2014-02-22 12:22:05 -08:00
José Valim
16b29baa5b Merge pull request #2876 from rbsec/master
Disable autocompletion on all password inputs
2014-02-22 09:16:25 +01:00
José Valim
49403267cf Merge pull request #2854 from aceofspades/omniauth_devise_route_context
Use _devise_route_context in omniauth url_helpers
2014-02-22 09:09:55 +01:00
Lucas Mazza
4d7473634e bcrypt-ruby is now bcrypt. 2014-02-21 18:33:59 -03:00
rbsec
13b50d63ca Set autocomplete=off on all password inputs 2014-02-21 10:37:17 +00:00
Lucas Mazza
b8f1d0d0c6 Release v3.2.3 2014-02-20 15:30:48 -03:00
José Valim
60b6a80764 Merge pull request #2868 from rmm5t/patch-1
Update password_length docs in config template
2014-02-16 14:45:05 +01:00
Ryan McGeary
5f9838950a Remove password_length default docs in config template
The default specified in the docs does not match up with the default
specified in the config.

See
cc8636cfed/lib/devise.rb (L127)

Changing the docs to read 6..128 with the config setting to 8..128 is
feared to cause confusion, so removing the default clause instead.
2014-02-16 08:19:47 -05:00
José Valim
0ece5d5190 Merge pull request #2869 from leriksen/master
Additional documentation on permitted scalars and nested parameter configuration
2014-02-16 10:04:26 +01:00
leriksen
058eac640f Additional documentation on simple scalars and nested types 2014-02-16 12:06:55 +11:00
José Valim
cc8636cfed Merge pull request #2866 from guilhermesimoes/readme-update
Readme update
2014-02-15 00:09:44 +01:00
Guilherme Simoes
e18b822567 Update README.md
The updates are:

* Indicate that it is possible to pass a block to `super` to add custom
  behaviour to some Devise controller actions without completely
  overriding them.

* Move mailer configuration out of the section "Controller filters and
  helpers".

* Consistently use Ruby 1.9's hash syntax, highlight code and capitalize
  "Devise".

* Wording improvements
2014-02-14 22:54:30 +00:00
Lucas Mazza
93bdee2640 Merge branch 'lm-migration-extension' 2014-02-11 11:00:16 -02:00
Lucas Mazza
e57b672e90 Ensure that migrations are created with the .rb extension.
Since rails/rails#13612 the generator won't always add the `.rb`
extension when creating migrations with the `migration_template`
method.
2014-02-11 10:19:05 -02:00
Lucas Mazza
e9351b7c15 Merge pull request #2857 from albertodotcom/patch-2
Update README.md
2014-02-10 23:57:45 -02:00
Alberto Forni
7c3e08d92d Update README.md
Substitute ; with .
2014-02-11 10:47:51 +11:00
Doug Puchalski
46c01d642b Use _devise_route_context in omniauth url_helpers 2014-02-02 16:45:26 -08:00
Rafael Mendonça França
2aedb1bf79 Merge pull request #2843 from willnet/patch-1
Fix homepage's schema
2014-01-25 21:37:43 -08:00
Shinichi Maeshima
9d87aa55bd Fix homepage's schema 2014-01-26 14:31:26 +09:00
José Valim
791657f3ef Merge pull request #2842 from slant/patch-1
Correct misspelling
2014-01-22 23:48:12 -08:00
Ryan L. Cross
8981c3ef9b Correct misspelling 2014-01-23 00:44:32 -07:00
José Valim
7a9ae13baa Merge pull request #2835 from plataformatec/secrets
Add support for Rails 4.1 secrets.
2014-01-22 05:33:11 -08:00
Lucas Mazza
eba91e6580 Read the secret_key value from Rails secret_key_base.
It is possible to override this by setting the `secret_key` manually
on the `devise.rb` initializer on your application.
2014-01-22 11:13:25 -02:00
José Valim
d5e0171cb4 Merge pull request #2832 from jwworth/master
Fix typos
2014-01-09 08:03:25 -08:00
Jake Worth
61e87be580 Fix typos 2014-01-09 10:00:27 -06:00
José Valim
e16278966f Merge pull request #2826 from tobinibot/fix-maximum-attempts
Fix off-by-one error in Lockable module
2014-01-06 23:43:55 -08:00
Tobin Juday
2ba8275dcc Fix off-by-one error in Lockable module
When using the maximum_attempts config, Devise actually let you fail n
+ 1 times, not n times.

See https://github.com/plataformatec/devise/issues/2825 for details.
2014-01-06 23:51:45 -05:00
Vasiliy Ermolovich
72a0d9e350 Merge pull request #2822 from plataformatec/rails-4.1
Fix specs on Rails 4.1
2014-01-04 10:14:57 -08:00
Vasiliy Ermolovich
6d51e67fac properly change devise config in specs 2014-01-04 19:19:13 +03:00
Lucas Mazza
7b66133861 Remove subscriber block so it won't leak across the test suite. 2014-01-04 19:01:05 +03:00
Vasiliy Ermolovich
49086d0294 remove warnings regarding number extensions 2014-01-04 18:54:19 +03:00
Vasiliy Ermolovich
1b1be514c8 make webrat compatible with rails 4.1 2014-01-04 18:53:40 +03:00
Vasiliy Ermolovich
9dbc60d36d update mocha 2014-01-04 18:52:54 +03:00
José Valim
3db4444da8 Update CHANGELOG.md
The described change was actually introduced in 2.2.4, closes #2804
2014-01-04 09:48:04 +01:00
José Valim
7a654cdd04 Merge pull request #2809 from moisesweb/mv_access_lock_without_email
lock_access! without sending email
2014-01-04 00:37:38 -08:00
Lucas Mazza
02c2ec69dd Remove platform constraints from the extra gemfiles. 2014-01-03 11:53:13 -02:00
Lucas Mazza
dd95f3f3f7 Support custom port for MongoDB config 2014-01-03 11:23:34 -02:00
Lucas Mazza
0cb74efd79 Remove platform constraint from Gemfile since we do not support 1.8 anymore. 2014-01-03 11:23:01 -02:00
Lucas Mazza
517bde86d2 Update bundler on Travis. 2014-01-03 10:12:30 -02:00
Lucas Mazza
2665afa36f 2014, folks. 2014-01-03 10:12:23 -02:00
Lucas Mazza
0b84a0e7c6 Merge pull request #2819 from salimane/pr_ruby_2_1_0
Add Ruby 2.1.0 to .travis.yml
2014-01-03 03:50:11 -08:00
Salimane Adjao Moustapha
db204f33e0 Add Ruby 2.1.0 to .travis.yml 2014-01-03 11:39:16 +01:00
Rafael Mendonça França
89ce9c922c Merge pull request #2818 from jrmyward/issue-2770
Edit is now configurable for devise registrations via path_name.
2014-01-02 19:13:03 -08:00
Jeremy Ward
9d0d15b814 Updated documentation to use 1.9 hash syntax. 2014-01-02 19:02:36 -08:00
Jeremy Ward
b50fa74596 Edit is now configurable for devise registrations via path_name. 2014-01-02 17:49:37 -08:00
Moises Vargas M
be236fa6dd lock_access! without sending email 2013-12-24 11:51:24 -05:00
José Valim
01e029fd9b Merge pull request #2806 from keating/master
revise readme
2013-12-21 03:21:03 -08:00
keating
4652b3efa0 revise readme 2013-12-21 19:09:09 +08:00
José Valim
29da146c07 Merge pull request #2802 from schneems/schneems/raise_controller_omniauthable
[close #2755] Raise incompatible route error
2013-12-20 00:53:23 -08:00
schneems
a00921f417 [close #2755] Raise incompatible route error
Right now if you try to use a route that you have defined in your `omniauth_callbacks` but you have not declared that resource to be `omniauthable` you will get a weird route missing error which causes the user to look in the routes for the fix:

```ruby
devise_for  :users, controllers: {omniauth_callbacks: "users/omniauth_callbacks"}
```

This PR checks to see if the mapping of `:user` has the module `omniauthable` included in it when `omniauth_callbacks` is specified in the route. If it does not, an instructional error is raised:

```
Mapping omniauth_callbacks on a resource that is not omniauthable
Please add `devise :omniauthable` to the `User` model
```
2013-12-18 19:19:25 -06:00
Rafael Mendonça França
71c43926e0 Add security related email address 2013-12-16 17:49:21 -02:00
Erich Kist
380ab682c5 Update travis to run with Rails 3.2-stable, 4.0-stable and master 2013-12-10 19:09:49 -02:00
José Valim
714176994b Merge pull request #2784 from yokomizor/remove_authentication_token_stuffs
Remove authentication some authentication token stuffs
2013-12-10 06:44:46 -08:00
Rogério Yokomizo
8ca34aa41e Remove authentication some authentication token stuffs
Since we don't have authentication token, we don't have to check if
password is "X".

:authentication_token don't have to be in the blacklist for
serialization too.
2013-12-10 12:30:28 -02:00
José Valim
3adeba38f5 Merge pull request #2763 from paulanunda/master
Fixed small grammatical error in en.yml
2013-12-09 21:50:20 -08:00
Luiz H. D. Costa
5b6f1e8f80 Merge pull request #2774 from yokomizor/fix_typo
Fix typo
2013-12-05 04:45:29 -08:00
Rogério Yokomizo
16ec143228 fix typo and some clarification 2013-12-05 10:39:42 -02:00
José Valim
c67de7e91c Merge pull request #2772 from sferik/gender_neutral_pronouns
Remove a couple more gendered pronouns
2013-12-05 00:09:48 -08:00
Erik Michaels-Ober
3f03ec02ad Cleanup trailing whitespace 2013-12-05 09:03:32 +01:00
Erik Michaels-Ober
4e7cd18a04 Remove a couple more gendered pronouns 2013-12-05 09:03:28 +01:00
Rafael Mendonça França
01f4a8f441 Merge pull request #2767 from bartoszkopinski/master
Removing regexp anchors in routing constraints
2013-12-02 12:39:27 -08:00
Bartosz Kopiński
53893edec8 Removing regexp anchors in routing constraints
They're not allowed according to:
http://guides.rubyonrails.org/routing.html#segment-constraints
2013-12-02 21:27:23 +01:00
José Valim
7d11427116 Merge pull request #2766 from sferik/gender_neutral_pronouns
Removed use of gendered pronouns
2013-12-02 01:22:46 -08:00
Erik Michaels-Ober
26e85c44e2 Removed use of gendered pronouns 2013-12-02 10:02:17 +01:00
Paul Anunda
43282f738e Fixed small grammatical error in en.yml 2013-11-28 10:29:50 -06:00
Vasiliy Ermolovich
c2718806a7 Merge pull request #2761 from reu/patch-1
Small typo. [ci skip]
2013-11-28 03:01:49 -08:00
Rodrigo Navarro
3e3a3ad102 Small typo. 2013-11-28 09:00:59 -02:00
José Valim
65947b6696 Release v3.2.2 2013-11-25 12:00:21 +01:00
Vasiliy Ermolovich
0028dc6a4f Merge pull request #2751 from fgo/patch-1
Fix spelling in README [ci skip]
2013-11-22 00:57:03 -08:00
Francis Go
f438209669 Fix spelling in README 2013-11-22 19:55:16 +11:00
José Valim
c85ecbb9ac Merge pull request #2750 from louman/master
Timeoutable - fixes missing caller
2013-11-21 08:38:12 -08:00
Marcus Mansur
b16899f7bf fixes timeoutable specs to cover sign_out_all_scopes false 2013-11-21 14:02:45 -02:00
Marcus Mansur
bd83483ba6 fixes missing caller 2013-11-21 13:26:34 -02:00
José Valim
0514e60bc4 Merge pull request #2749 from csexton/master
Keep the query string and path in store_location_for
2013-11-20 13:13:12 -08:00
Christopher Sexton
7afc096fa4 Keep the query string and path in store_location_for
Persist the URI's query when saving to the session.

Fixes #2742
2013-11-20 15:47:20 -05:00
Vasiliy Ermolovich
bb2ff3553b require rails generator base class in devise generators
closes #2743
2013-11-15 15:56:09 +03:00
José Valim
1390945e5c Improve default omniauth sample 2013-11-14 09:09:05 +01:00
José Valim
f36efc0cc9 Ensure multiple leading / are also removed, thanks @homakov 2013-11-13 15:01:23 +01:00
José Valim
3b598ec235 Release v3.2.1 2013-11-13 14:15:13 +01:00
José Valim
95ec62ea76 Ensure encryption on authentication 2013-11-13 13:45:34 +01:00
José Valim
9a412c139f Update CHANGELOG 2013-11-13 13:32:59 +01:00
José Valim
0582467032 Ensure we only store paths in store_location_for (thanks to @homakov for the tip) 2013-11-13 13:30:24 +01:00
José Valim
221be6d6ef Update bundled rails app 2013-11-13 13:29:25 +01:00
José Valim
ed86361b92 Merge pull request #2728 from edelpero/master
Adds yield around resource on devise controllers
2013-11-08 23:22:53 -08:00
José Valim
e303de9756 Merge pull request #2729 from matthewrudy/store-location-helper
Add store_location_for helper
2013-11-08 23:22:39 -08:00
Matthew Rudy Jacobs
268e486dbb Add store_location_for helper
This is used as a complement to `stored_location_for`.

Example:

Before authorizing with Omniauth;

  store_location_for(:user, dashboard_path)
  redirect_to user_omniauth_authorize_path(:facebook)

In our Omniauth callback

  sign_in(user)
  redirect_to stored_location_for(:user) || root_path
2013-11-09 00:59:00 +00:00
Ezequiel Delpero
989071144e Adds yield around resource on devise controllers
If you want to add a new behavior to your devise
controllers but you don't want to override devise's
default workflow, just pass a block around resource.

This would give you for example, the ability to
trigger background jobs after user signs in.
2013-11-08 20:43:08 -03:00
Rafael Mendonça França
25726becdd Merge pull request #2731 from plataformatec/lm-password-digest
Bring `password_digest` back.
2013-11-08 10:28:11 -08:00
Lucas Mazza
bf5bcd52cb Bring password_digest back.
This method is part of the protected API and is used by custom
encryption engines (like `devise-encryptable`) to hook the custom
encryption logic in the models.

Fixes #2730
2013-11-08 16:22:31 -02:00
José Valim
e26ea51fe5 Improve error message for wrongly nested omniauth callback 2013-11-07 14:30:32 +01:00
José Valim
c840fc419f Update Rails 3.2 lock too 2013-11-06 21:50:04 +01:00
José Valim
9d872709c0 Release Devise 3.2.0 2013-11-06 21:39:16 +01:00
José Valim
27bcefcf54 Ensure timeoutable hook respects Devise.sign_out_all_scopes configuration
Closes #2606
2013-11-06 21:07:38 +01:00
José Valim
4f1bf8f3f9 Split out sign_in/out functionality so it can be reused in hooks 2013-11-06 20:55:26 +01:00
José Valim
d49f0a1184 Update CHANGELOG 2013-11-06 20:34:57 +01:00
José Valim
a7624c8f51 Merge pull request #2227 from AlexanderZaytsev/master
Use mapping.fullpath in omniauth callbacks
2013-11-06 11:32:21 -08:00
andrew morton
52a3768451 A GET to sign in shouldn't extend the session. 2013-11-06 20:20:22 +01:00
José Valim
f5f7e97d8b Merge pull request #2718 from ssendev/flashing_formats
Separate redirects and flash messages in navigational_formats and flashing_formats
2013-11-06 00:10:23 -08:00
José Valim
13117f01be Merge pull request #2562 from devolute/master
passes headers through test helpers' response
2013-11-05 23:59:11 -08:00
Kaworu
fe1fb1f7a2 Don't use config option for flashing_formats 2013-11-01 22:25:15 +01:00
Kaworu
c87809a0f5 Separate redirects and flash messages in navigational_formats and flashing_formats 2013-11-01 21:47:40 +01:00
José Valim
9eb0768cb9 Add Rails 4 related todo 2013-10-31 14:40:44 +01:00
José Valim
e445039716 Merge pull request #2717 from memberful/2716-splat-sanitize-params
Splat the arguments to strong_parameters#permit, fixes #2716
2013-10-31 14:40:28 +01:00
José Valim
69d28f9b0e Add config.last_attempt_warning to default config 2013-10-26 11:56:31 +02:00
José Valim
5cb575bd48 Merge pull request #2705 from 13k/master
Fix configuration option name in CHANGELOG.
2013-10-24 14:43:37 -07:00
Kiyoshi '13k' Murata
88de877f8b Fix configuration option name in CHANGELOG.
[ci skip]
2013-10-24 19:37:47 -02:00
José Valim
5a363f5fcb Merge pull request #2703 from bbenezech/master
Add options for FailureApp's i18n_message. Similar #1633
2013-10-24 09:10:19 -07:00
Benoit Bénézech
04e47687b2 remove respond_to in favor of an implementation that returns options 2013-10-24 17:29:53 +02:00
Benoit Bénézech
d5514bf916 Add options for FailureApp's i18n_message. Similar #1633 2013-10-24 16:49:13 +02:00
José Valim
93649e21d0 Merge pull request #2700 from obiwanchinobi/task/document-after-db-auth-hook
Add documentation to the 'after_database_authentication' method.
2013-10-23 23:35:47 -07:00
Dave Tong
8bef8b87f1 Add documentation to the 'after_database_authentication' method. 2013-10-24 08:25:00 +11:00
José Valim
fb530110c7 Merge pull request #2697 from Lightpower/feature/last_attempt_message
Show last attempt message for last attempt, not for one-before-last one
2013-10-22 01:33:37 -07:00
Vitaly Bezkrovny
bb810cfb8f * show message for last attempt, not for one-before-last one;
* update test to check the message :invalid, :last_attempt, :locked
2013-10-22 00:43:56 +03:00
José Valim
a8069be4c8 Improve devise_for docs to be make routes integration more explicit 2013-10-21 13:28:20 +02:00
Jay Hayes
2296d14803 Add entry to changelog
[#2691]
[ci skip]

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>

Conflicts:
	CHANGELOG.md
2013-10-21 13:21:43 +02:00
Jay Hayes
21583cbf95 Update code comment to keep it up to date
[#2691]
[ci skip]
2013-10-21 13:21:11 +02:00
Jay Hayes
4861436298 Prevent mutation of orig values during case and wspace sanitizations 2013-10-21 13:21:05 +02:00
Vasiliy Ermolovich
844d467ab9 Update CHANGELOG [ci skip] 2013-10-20 17:55:51 +03:00
Vasiliy Ermolovich
520e2845ae Merge pull request #2689 from Lightpower/master
* typo
2013-10-16 14:53:38 -07:00
Vitaly Bezkrovny
aba19c1ca4 * typo 2013-10-16 23:57:11 +03:00
José Valim
986f52df2b Merge pull request #2687 from Lightpower/master
Warning of the last attempt password entering
2013-10-16 01:33:41 -07:00
Vitaly Bezkrovny
e20e446cf4 + last_attempt
+ @@last_attempt_warning

+ last_attempt? method;
* send :last_attempt key if it is the last attempt

+ test for last attempt

* update test to make two asserts

* update message
2013-10-15 01:53:56 +03:00
José Valim
e947a9cbec Merge pull request #2674 from jessy/master
Fix #2673 email templates generated with the good @token
2013-10-08 02:28:30 -07:00
Jessy Bernal
fa06b33dd3 Fix #2673 email templates generated with the good @token 2013-10-08 11:25:04 +02:00
José Valim
31971e69e6 Merge pull request #2669 from plataformatec/pr-2598-fixed
Fixed version of PR #2598
2013-10-06 04:22:45 -07:00
Vasiliy Ermolovich
fa16afd90a add CHANGELOG entry 2013-10-06 14:19:19 +03:00
Vasiliy Ermolovich
0d6493a9a5 proper hash comparing in Devise.bcrypt test 2013-10-06 14:19:08 +03:00
Aaron Patterson
5300bdabc8 add a class method so you can encrypt passwords from fixtures 2013-10-06 13:53:12 +03:00
José Valim
93f59dd63a Update CHANGELOG.md 2013-10-04 20:04:23 +02:00
José Valim
9281ac3958 Merge pull request #2663 from scaryzet/fix_expire_session_data_after_sign_in
Fix expire_session_data_after_sign_in!
2013-10-03 08:40:04 -07:00
Vasiliy Ermolovich
52300c033d Merge pull request #2662 from plataformatec/issue-2659
do not define mailer if ActionMailer is not defined
2013-10-03 08:17:18 -07:00
Vasiliy Ermolovich
036715facc do not define mailer if ActionMailer is not defined
closes #2659
2013-10-03 17:39:04 +03:00
Ivan Zhidkov
2351d0215a Fix expire_session_data_after_sign_in! 2013-10-03 18:34:39 +04:00
José Valim
eaad61b2da Make it clear a restart is required when setting the secret key 2013-10-01 17:12:08 +02:00
José Valim
c323065b57 Merge pull request #2634 from gregates/bug/confirmation_workflow
Tweaks confirmation flow for signed_in users
2013-09-16 07:17:46 -07:00
Greg Gates
989d7192fa Tweaks confirmation flow for signed_in users
For #2627

When allow_unconfirmed_access_for > 0, users may
be already signed in at the time they confirm
their account. Consequently, the default
confirmation should be compatible with this
possibility. Additionally, they should not be
redirected to the sign in form after confirmation
in this case. So I've changed
ConfirmationsController#after_confirmation_path_for
to send the user to the root path when signed in,
or the sign in form otherwise.
2013-09-16 10:12:15 -04:00
Vasiliy Ermolovich
acefa2f761 Merge pull request #2631 from vipulnsward/cleanup_tests
Cleanup tests for unused variables
2013-09-14 14:53:23 -07:00
Vipul A M
ae6a37f796 Cleanup tests for unused variables 2013-09-15 01:52:53 +05:30
Vasiliy Ermolovich
d75fd56f15 remove unused reset_password_token method
closes #2621
2013-09-14 12:30:23 +03:00
Vasiliy Ermolovich
4216c34538 fix markdown in CHANGELOG [ci skip]
closes #2626
2013-09-13 22:29:34 +03:00
José Valim
b24d178b21 Merge pull request #2628 from ricardohsd/master
Update wiki link on README.md
2013-09-13 04:53:58 -07:00
Ricardo Henrique
fc5522a8ed Update wiki link on README.md 2013-09-13 08:47:27 -03:00
Rafael Mendonça França
041fcf9080 Merge pull request #2608 from benmanns/patch-1
Update link to new contributors page
2013-09-04 11:46:07 -07:00
Benjamin Manns
f45d874ed9 Update link to new contributors page [ci skip] 2013-09-04 14:43:45 -04:00
Carlos Antonio da Silva
47d9f1b959 Fix changelog [ci skip] 2013-09-03 08:47:57 -03:00
José Valim
9464416c3e Bring back test removed by accident 2013-09-02 19:25:05 -03:00
José Valim
6b3b0c5e8c Remove deprecated token lookups 2013-09-02 19:23:15 -03:00
José Valim
dff7891b97 Get rid of token authentication 2013-09-02 19:15:47 -03:00
José Valim
07f0ee75ee Link to update gist on CHANGELOG for 3.0 update 2013-09-02 19:04:51 -03:00
José Valim
08edcc10fe Release 3.1.0 2013-09-02 19:02:48 -03:00
José Valim
2d919fba32 Merge pull request #2582 from tod-uma/master
Allowed updating of attributes without a password if password_required? resolves to false.
2013-09-02 14:46:08 -07:00
José Valim
843168d5c7 Merge pull request #2605 from sekrett/master
Handle nil failed_attempts
2013-09-02 04:44:48 -07:00
Alexander Zubkov
095572b6fd Add nulls to migration generator 2013-09-02 15:00:12 +04:00
Alexander Zubkov
b9112d4308 Handle nil failed_attempts 2013-09-02 14:48:19 +04:00
Vasiliy Ermolovich
23c5517009 add test for fc251c306c 2013-08-31 15:25:49 +03:00
José Valim
32e60fade5 Merge pull request #2604 from gregates/revise_locale_messages
Fixes incorrect flash message on confirmation
2013-08-31 02:49:02 -07:00
Greg Gates
fc251c306c Fixes incorrect flash message on confirmation
The :confirmed default message in devise.en.yml
used to say "You are now signed in." This is no
longer the default behavior in v3.1.0.

This commit renames that message to
:confirmed_and_signed_in and changes the :confirmed
message to be appropriate for the default post-
confirmation location (which is now the new session
page). The new :confirmed message reads:

"Your account was successfully confirmed. Please
sign in."
2013-08-30 17:16:56 -04:00
Rafael Mendonça França
f6a74e90e5 Merge pull request #2603 from rwz/patch-1
Consistent single quotes in devise.rb generator
2013-08-30 09:28:43 -07:00
Pavel Pravosud
91f2bce08e Consistent single quotes in devise.rb generator 2013-08-30 22:21:12 +07:00
Rafael Mendonça França
5e81210400 Merge pull request #2601 from theodorton/patch-1
Typo
2013-08-30 07:39:27 -07:00
Theodor Tonum
4b7fcac23a Typo 2013-08-30 16:38:34 +02:00
José Valim
213ed81641 Update CHANGELOG.md 2013-08-27 07:05:54 -03:00
José Valim
3232d14b20 token authenticatable mentions 2013-08-21 17:33:38 +02:00
José Valim
949c9e5ded Remove gem version from README (because it doesn't work when branched) 2013-08-21 17:30:01 +02:00
Tod Detre
66c829eef4 created update_resource method to allow subclass overwritting 2013-08-21 11:04:32 -04:00
Tod Detre
6a22e88dfa Allowed updating of attributes without a password if password_required? resolves to false 2013-08-20 16:36:35 -04:00
José Valim
605924a921 Add a test related to remember token generation 2013-08-19 20:48:36 +02:00
José Valim
72c3472fe1 Generate remember token 2013-08-19 20:33:21 +02:00
José Valim
ea870e0636 Credit where credit is due [ci skip] 2013-08-18 10:46:00 +02:00
José Valim
3f00d735a4 Mention the security announcement [ci skip] 2013-08-18 10:17:51 +02:00
José Valim
1437ae2ce3 Release v3.1.0.rc2 2013-08-18 10:13:53 +02:00
Andri Möll
052cbef205 Don't confirm email after password reset.
Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2013-08-18 10:13:35 +02:00
José Valim
b1754074e5 Only raise on missing secret key after a route is defined 2013-08-18 09:55:05 +02:00
José Valim
e8b70bb04d Include registration on docs 2013-08-17 09:19:28 +02:00
José Valim
58cbd91512 Do not do double redirect on after confirmation path 2013-08-13 18:55:50 +02:00
Carlos Antonio da Silva
177ed8a356 Bump up lock dependencies 2013-08-13 13:43:40 -03:00
Carlos Antonio da Silva
a5e63d7a28 Update Gemfile.lock with new Devise version
Also bump master with latest mongoid
2013-08-13 13:43:21 -03:00
José Valim
5ecbbdf260 Update version.rb 2013-08-13 18:22:19 +02:00
José Valim
efe34219a9 Fix the build on Rails 3.2 2013-08-12 15:36:41 +02:00
José Valim
bc0cab8d60 Update README.md
Remove unnecessary maintainers list
2013-08-12 15:25:44 +02:00
José Valim
7e855eddef Credit where credit is due 2013-08-11 22:30:19 +02:00
José Valim
8541c465d7 Convert CHANGELOG to markdown 2013-08-11 22:20:59 +02:00
José Valim
4e318b5167 Simplify parameter sanitization proposal 2013-08-11 22:20:59 +02:00
Alex Peattie
5e7caffc9e Extend params sanitizer, to make it easier to add/remove permitted params
- Move the default permitted parameters into ParameterSanitizer::PermittedParameters
- Add devise_permitted_parameters helper
- devise_permitted_parameters.add to add permitted parameters
- devise_permitted_parameters.remove to remove Devise's defaults
- devise_permitted_parameters.for to access the parameters for a given action
- Update 'Strong Parameters' section of README

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2013-08-11 22:20:59 +02:00
José Valim
87edf0fbcf Merge pull request #2564 from glebm/doc-confirmable-fix
fix doc typo
2013-08-09 23:49:44 -07:00
Gleb Mazovetskiy
e7de0d4c4c fix doc typo 2013-08-10 04:43:25 +02:00
José Valim
2a8d0f9bee Update CHANGELOG 2013-08-09 10:30:29 +02:00
chris
a1d83d5d4e passes headers through test helpers' response 2013-08-09 09:51:05 +02:00
José Valim
4681f81ce6 Document the :store option for sign in 2013-08-09 08:37:27 +02:00
José Valim
86f2696b84 Merge pull request #2529 from papercavalier/lang-edit
Grammar
2013-08-08 13:39:50 -07:00
José Valim
20cf73facf Merge pull request #2549 from joaomilho/master
Using urlsafe_base64 cause it already handle url sensitive chars, keepin...
2013-08-08 13:38:05 -07:00
José Valim
d0219d914f Merge pull request #2560 from aarvay/patch-1
Added an extra validation to shared links
2013-08-08 13:37:45 -07:00
José Valim
50d17bbb8e Update CHANGELOG 2013-08-08 22:37:15 +02:00
José Valim
3dccf3c6ff Do not sign in after confirmation 2013-08-08 22:33:58 +02:00
Vignesh Rajagopalan
acd33174fc Added an extra validation to shared links 2013-08-08 18:05:19 +05:30
José Valim
d56641f514 Move to SHA256 2013-08-06 12:14:51 +02:00
José Valim
354e5022bf Only allow insecure token lookup if a flag is given 2013-08-06 11:55:13 +02:00
José Valim
3cdbf15fe9 Update OTHER lock 2013-08-05 19:24:04 +02:00
José Valim
143794d701 Use HMAC on tokens stored in the DB 2013-08-05 18:56:07 +02:00
Juan Lulkin
4048545151 Using urlsafe_base64 cause it already handle url sensitive chars, keeping the replacement of the confusing chars, though 2013-08-05 14:54:56 +03:00
José Valim
32648027e2 Add Devise::KeyGenerator 2013-08-05 11:47:36 +02:00
José Valim
7e96bac6a4 Get rid of deprecated code 2013-08-05 11:24:04 +02:00
José Valim
f5a77ac598 Skip storage for cookies on unverified requests 2013-08-05 10:24:11 +02:00
José Valim
591f4a97f7 Update the OTHER gemfile 2013-08-02 23:57:43 +02:00
José Valim
cf1989e1da Update Gemfile.lock 2013-08-02 23:43:07 +02:00
José Valim
7c8c0f8dba Release 3.0.1 2013-08-02 23:25:11 +02:00
José Valim
66afa2a2bf Update CHANGELOG 2013-08-02 23:14:54 +02:00
José Valim
747751a20f Protect against CSRF token fixation attacks 2013-08-02 23:13:15 +02:00
José Valim
8e0327e203 Merge pull request #2530 from barodeur/patch-1
Remove trailing whitespaces
2013-07-28 14:25:39 -07:00
Paul Chobert
d88b3cedfb Remove trailing whitespaces 2013-07-28 23:15:42 +02:00
hakanensari
9a60415e2e Fix assertion 2013-07-26 19:31:49 +01:00
hakanensari
b861a65e72 Fix run-on sentence 2013-07-26 14:24:19 +01:00
hakanensari
1ab7792beb Fix grammar 2013-07-26 14:24:13 +01:00
José Valim
c4d5a3fdaa No need to assert for a message we won't receive 2013-07-26 10:00:09 +02:00
José Valim
11a77055f1 Merge pull request #2525 from jetthoughts/timeoutable-without-rememberable
Fixed checking for rememberable in timeoutable
2013-07-26 00:58:09 -07:00
José Valim
9bc8e1211b Update CHANGELOG 2013-07-26 09:22:59 +02:00
José Valim
cd1bc53947 Do not generate attr_accessible for any Rails 4 app 2013-07-26 09:22:03 +02:00
Michael Nikitochkin
fffbeb5cc7 Fixed bug when user has field remember_created_at but the module rememberable is not enabled for the user 2013-07-26 10:20:29 +03:00
José Valim
7539d31a05 Update 3.2 Gemfile 2013-07-26 09:17:35 +02:00
José Valim
78fedd6c10 Merge pull request #2523 from Neschur/add_method_after_confrimation
Added method after_confrimation
2013-07-25 23:59:50 -07:00
José Valim
14a0cfefaa Merge pull request #2522 from jcoyne/attr_accessible
When using rails 3.2, the generator adds 'attr_accessible' to the model....
2013-07-25 23:56:03 -07:00
Justin Coyne
b7e67115fc When using rails 3.2, the generator adds 'attr_accessible' to the model. Fixes #2515 2013-07-23 22:49:05 -05:00
Siarhei Hanchuk
b7bc8dec12 Added method after_confrimation 2013-07-23 14:19:58 +03:00
José Valim
b8ed2f3160 Clarify the roles of Devise models 2013-07-23 10:21:01 +02:00
José Valim
b46b7e3736 Release v3.0.0 2013-07-14 20:40:56 +02:00
José Valim
c5ef39f087 Bump to Warden 1.2.3 2013-07-14 20:40:09 +02:00
José Valim
cfb8228de9 Merge pull request #2506 from mxhold/master
Update README.md
2013-07-14 11:20:35 -07:00
Max Holder
4e0c598de1 Update README.md
Replace case statement with if statement since we're comparing two equivalent classes (which would never be case equivalent).
2013-07-14 10:35:11 -04:00
José Valim
fed6a92d55 Merge pull request #2504 from plataformatec/remember-me
Add remember_me to the permitted sign_in params
2013-07-12 12:19:35 -07:00
Vasiliy Ermolovich
2c1ca126f4 add remember_me to the permitted sign_in params 2013-07-12 22:14:32 +03:00
Vasiliy Ermolovich
36fb1ecf4d update Gemfile.lock 2013-07-12 22:13:52 +03:00
José Valim
08986dbd4b Merge pull request #2502 from slainer68/readme_strong_parameters
Update README.md [ci skip]
2013-07-12 04:26:59 -07:00
Nicolas Blanco
b69d2c412f Update README.md [ci skip]
Fix the example for Strong parameters multi roles as resource_class is actually a class not an instance.
2013-07-12 13:25:26 +02:00
José Valim
6f5d176e8e Bump warden dependency 2013-07-12 13:00:31 +02:00
José Valim
57515de5ad Update to Rails 4.0 2013-07-09 09:09:22 +02:00
José Valim
49aebde435 Update CHANGELOG 2013-07-09 09:05:19 +02:00
José Valim
bc598b9da3 Merge pull request #2452 from latortuga/bad-strong-params-on-failed-login
Add failing test case for bad parameter sanitizing when failing to login
2013-07-08 23:53:41 -07:00
José Valim
da0323e591 Merge pull request #2419 from plataformatec/issue-2418
set error to the field specified in unlock_keys config
2013-07-08 23:52:19 -07:00
José Valim
061e9d7404 Merge pull request #2475 from tkhr/enable_skipping_reconfirmation_notification_but_regenerate_confirmation_token_2
Enable to skip sending reconfirmation email when reconfirmable is on and skip_confirmation_notification! is invoked
2013-07-08 23:51:42 -07:00
José Valim
3c519b13ff Merge pull request #2485 from betelgeuse/changelog_fix
CHANGELOG fix about _links.erb partial revert
2013-07-03 03:58:13 -07:00
Petteri Räty
aeec6138c2 CHANGELOG fix about _links.erb partial revert
9bf718 got reverted by aa2d15 but the CHANGELOG was not reflected to
show this.
2013-07-03 13:34:25 +03:00
José Valim
75ad4ee87b Add thread-safety support note 2013-06-30 14:18:57 +02:00
Drew Ulmer
e029ad7b0c Fix improper login param sanitization permit
This includes a failing test case that hooks into ActiveSupport
Notifications to catch the param permit error.
2013-06-25 13:44:39 -05:00
José Valim
225afe6813 Merge pull request #2480 from robinroestenburg/patch-1
Updated section 'Configuring controllers'
2013-06-25 04:19:23 -07:00
Robin Roestenburg
8487637b2f Updated section 'Configuring controllers'
I added an extra note in the section on creating a custom (namespaced) controller. 

This controller needs to be created in a directory in order for it to work. Otherwise (for example when creating the controller in `app/controllers`) a `uninitialized constant Admins` error is thrown.

Also, fixed the Markdown formatting for the numbered lists in the README.
2013-06-25 14:01:11 +03:00
José Valim
8978bd4fe0 Merge pull request #2479 from djmaze/patch-1
Update code example for #update_without_password
2013-06-25 02:30:41 -07:00
Martin Honermeyer
5926898cf4 Update code example for #update_without_password 2013-06-25 11:27:35 +02:00
Takehiro Adachi
df2995ce19 Enable to skip sending reconfirmation email when skip_confirmation_notification! is invoked
We could always generate a confirmation token but not sending a
confirmation email by invoking the skip_confirmation_notification!
method when creating the account.
But there were no way to do that when we were turning on reconfirmable
and updating email.
2013-06-20 08:21:54 +09:00
José Valim
5717c6f082 Splat args to be sanitized 2013-06-19 10:37:37 +02:00
José Valim
72cf2481b5 Rename ParamFilter to ParameterFilter for consistency 2013-06-19 09:17:54 +02:00
José Valim
5c39a0c6d1 Merge pull request #2458 from t-kot/fix_access_locked_return_value
Fix access_locked? always return boolean
2013-06-12 20:45:25 -07:00
José Valim
56a26bd280 Merge pull request #2464 from sslotnick/expose_reset_confirm_tokens
Expose reset password and confirmation tokens
2013-06-12 20:44:45 -07:00
Steve Slotnick
b194882b23 Renaming get_or_create_*_token to ensure_*_token to match API in token authenticatable 2013-06-12 15:10:14 -07:00
Steve Slotnick
b5909f9b93 changing name from *_token! to get_or_create_*_token 2013-06-11 14:14:17 -07:00
Steve Slotnick
3c9cfa50c0 Adding publicly available methods on Recoverable and Confirmable to retrieve tokens 2013-06-10 19:17:19 -07:00
t-kot
e632240aee Fix access_locked? always return boolean 2013-06-07 12:11:00 +09:00
José Valim
176158a309 Just for Rails 3.2 2013-06-06 00:45:02 +08:00
Vasiliy Ermolovich
2503f2d0a8 Merge pull request #2453 from jroes/patch-1
Code formatting for class names and command [ci skip]
2013-06-05 06:32:02 -07:00
Jonathan Roes
85897b4fe2 Code formatting for class names and command 2013-06-05 09:22:55 -04:00
José Valim
fdd47d74db We are not duck typing here, so don't call the variable duck 2013-06-01 10:06:33 +09:00
Carlos Antonio da Silva
ae4448403c Change flash message to alert instead of error
Devise uses the defaults :notice and :alert everywhere, this one seems to
have been missed since it was introduced in
ff75341c75.
2013-05-29 21:34:28 -03:00
José Valim
2ead747be6 Merge pull request #2444 from julp/no_ghost_transactions
Fix empty transactions created by devise
2013-05-29 16:50:41 -07:00
julp
10aadee637 record is potentially unchanged here, if so, no needs to save it 2013-05-29 19:27:02 +02:00
julp
7670eb8e98 don't update failed_attempts attribute if already equal to 0 2013-05-29 19:24:51 +02:00
José Valim
486dc65884 Merge pull request #2430 from kramerc/blank-email
Avoid sending confirmations to blank emails.
2013-05-27 12:13:05 -07:00
Kramer Campbell
17e85aa79d Avoid sending confirmations to blank emails.
At times, validations may be skipped and no email address may be
provided. Such an instance comes when testing uniqueness validations of
specific attributes in a Devise model with confirmable, especially when
using Shoulda matchers.
2013-05-22 19:48:06 -07:00
José Valim
10c9a492ab Merge pull request #2427 from plataformatec/issue-2421
redirect user to the referrer if latest request was not GET after timeout
2013-05-19 08:07:43 -07:00
Vasiliy Ermolovich
b7079c7cf2 redirect user to the referrer if latest request was not GET after timeout
closes #2421
2013-05-19 17:11:34 +03:00
Vasiliy Ermolovich
55e69b18a4 Merge pull request #2424 from emilsoman/doc-fix
Update doc to mention http_authenticable is false by default [ci skip]
2013-05-17 14:29:31 -07:00
Emil Soman
020341176c Update doc to mention http_authenticable is false by default 2013-05-18 01:50:06 +05:30
Vasiliy Ermolovich
a79846730e Merge pull request #2422 from x3qt/patch-1
Fix typo in README.md [ci skip]
2013-05-17 04:19:16 -07:00
Yuri Pole
48eea9d325 Fix typo in README.md 2013-05-17 14:08:08 +03:00
Vasiliy Ermolovich
dd7c3ee91f set error to the field specified in unlock_keys config
closes #2418
2013-05-14 17:41:47 +03:00
José Valim
4e2cdc2d5b Merge pull request #2413 from jbhannah/master
Fix redundant assignment of self.resource in Devise::RegistrationsController
2013-05-09 21:40:11 -07:00
Jesse B. Hannah
545a5cec3b Fix redundant assignment of self.resource in Devise::RegistrationsController
Devise::RegistrationsController#create set self.resource to the return value of build_resource--which is nil, because build_resource sets self.resource to an actual resource object. This caused attempting to save the resource (two lines down) to fail with "undefined method `save' on nil:NilClass."
2013-05-09 18:33:30 -06:00
José Valim
ab77e08690 Update README.md 2013-05-07 16:18:48 -06:00
Carlos Antonio da Silva
39c1a2c7d0 Release 3.0.0.rc with Rails 4 support 2013-05-07 13:32:03 -03:00
Carlos Antonio da Silva
270e2ece19 Merge pull request #2376 from plataformatec/rails4
Support Rails 4

Keep compatibility with Rails 3.2. Drop support to Ruby 1.8.
2013-05-07 09:22:23 -07:00
Carlos Antonio da Silva
6b5988d756 Add changelog note about Rails 4 and Strong Params support
Plus dropping support for Rails < 3.2 and Ruby < 1.9.3
[ci skip]
2013-05-07 13:12:58 -03:00
Carlos Antonio da Silva
a4efbb9ad6 Update mongo revision 2013-05-07 13:05:02 -03:00
Carlos Antonio da Silva
eb0ad1c21a Merge branch 'master' into rails4 2013-05-07 13:01:34 -03:00
Carlos Antonio da Silva
f5e33089a0 Release 2.2.4 2013-05-07 12:51:46 -03:00
José Valim
e499fadf52 Use persisted? in order to check if the record was destoryed or not 2013-05-07 08:55:30 -06:00
Carlos Antonio da Silva
70199ed039 Bump webrat to 0.7.3 on 3.1 as well 2013-05-07 11:48:03 -03:00
Carlos Antonio da Silva
fb07558082 Update changelog with latest fixes [ci skip] 2013-05-07 11:48:03 -03:00
José Valim
5ad122b928 Fix build for mongoid 2013-05-07 08:47:18 -06:00
José Valim
c78b4b40c1 Remove warning since webrat is emitting tons of them 2013-05-07 08:22:06 -06:00
José Valim
ef2a2280a3 Update examples to be compatible with Rails 4 2013-05-07 08:18:12 -06:00
Carlos Antonio da Silva
42fca4dbe5 Update 3.1 lock file 2013-05-07 11:12:58 -03:00
José Valim
03f2a6a5e4 Merge pull request #2392 from michiel3/master
Add destroy_with_password method
2013-05-07 07:11:47 -07:00
José Valim
cc2fea8276 Merge pull request #2402 from xtream/master
Avoid duplication on param filter
2013-05-07 07:09:47 -07:00
José Valim
bb4cc2428f Merge pull request #2407 from sebastianwr/master
No redirect when accessing devise API via JSON
2013-05-07 07:08:53 -07:00
Sebastian Wramba
43f7cf0f12 No redirect when Devise API is accessed via JSON 2013-05-07 10:18:23 +02:00
Carlos Antonio da Silva
bb5d65209a Change rubygems source to use https [ci skip] 2013-05-06 23:04:49 -03:00
Carlos Antonio da Silva
69f79ad446 Let Devise play with both Rails 3.2 and Rails 4 for now 2013-05-05 19:55:06 -03:00
Victor Cruz Dueñas
75fdd2944d Avoid hash mutation 2013-05-05 10:12:57 +02:00
Victor Cruz Dueñas
ae48fc8419 Refactor to avoid duplication on param filter 2013-05-05 01:19:37 +02:00
Victor Cruz Dueñas
d6d61fc5be Adding tests for case_insensitive_keys and strip_whitespace_keys to param filter 2013-05-05 01:02:48 +02:00
Victor Cruz Dueñas
19c8f0c0ad Merge remote-tracking branch 'upstream/master'
Conflicts:
	app/controllers/devise/registrations_controller.rb
	test/integration/registerable_test.rb
2013-05-05 00:20:34 +02:00
Rafael Mendonça França
63627d1439 Refactoring the code a little bit
* Rename #get_constraints_given_method to #constraints_for to make the
  method clear.

* The method name now is required.

* Use symbols instead of strings.

* Make #constraints_for a protected method.
2013-05-04 14:33:55 -03:00
José Valim
662f0e76d8 Merge pull request #2401 from jd-erreape/master
Refactor to avoid repeated code
2013-05-04 09:06:16 -07:00
DI2uNk
eadce2fef6 Refactored rails/routes.rb to avoid repeated code 2013-05-04 11:56:56 +02:00
Carlos Antonio da Silva
0fe0373144 Fix location of parameter sanitizer in docs [ci skip] 2013-05-03 22:52:26 -03:00
Carlos Antonio da Silva
1f9ebbd9f4 Update gemspec dependency to Rails 4 rc1 as well 2013-05-03 22:04:27 -03:00
Carlos Antonio da Silva
a0058d5fbf Add some spaces, remove comment 2013-05-03 21:52:00 -03:00
Carlos Antonio da Silva
e8d1c9ca23 Bump rails version to 4.0.0.rc1, closes #2399 2013-05-03 10:00:39 -03:00
Carlos Antonio da Silva
d9d5ae3d58 Correct OrderedHash initialization to ensure keys order in 1.8.7
This should hopefully fix the build with 1.8.7 🙏
2013-05-01 21:35:03 -03:00
Rafael Mendonça França
b51c7fe59b Merge pull request #2396 from nickborromeo/show_license_in_gemspec
Fix gemspec so that MIT license will be visible when running the -d flag

Closes #2390
2013-04-30 10:34:54 -07:00
Nick Borromeo
a6b754b697 Fix gemspec so that MIT license will be visible when running the -d flag 2013-04-30 10:23:50 -07:00
Michiel Prins
92218e9ecc Remove unnecessary code 2013-04-29 15:21:31 +02:00
Michiel Prins
60e933df73 Add destroy_with_password method 2013-04-29 15:06:13 +02:00
José Valim
b451fc0aad Merge pull request #2391 from stereoscott/patch-1
Fix spelling error in doc block
2013-04-28 22:20:59 -07:00
Scott M
2f28e48f54 Fix spelling error in doc block 2013-04-29 01:52:37 -03:00
Carlos Antonio da Silva
76e4967ca1 Update travis-ci link in README [ci skip] 2013-04-28 13:06:08 -03:00
Vasiliy Ermolovich
dceb788c6b fix OrderedHash initialization 2013-04-23 10:37:10 +03:00
Vasiliy Ermolovich
fae8e977e8 use ordered hash to fix tests on ruby 1.8 2013-04-22 22:42:49 +03:00
Vasiliy Ermolovich
0a588fab3a update CHANGELOG [ci skip] 2013-04-22 17:51:54 +03:00
Vasiliy Ermolovich
bbf57214ac Merge pull request #2384 from worker8/after_reset_password_redirect_path
Add ability to override the redirect path after user has reset their password
2013-04-22 07:36:41 -07:00
Tan Jun Rong
804fbdf6d5 Fix spelling error, 'reseting' to 'resetting' 2013-04-22 22:25:40 +08:00
Tan Jun Rong
e4987e8bb7 Fix resource_name to resource 2013-04-22 21:40:52 +08:00
Tan Jun Rong
9d5a9c8a61 Add ability to override the redirect path after user has reset their password 2013-04-22 20:22:53 +08:00
Carlos Antonio da Silva
c8aa5f3e62 Bump webrat to 0.7.3 2013-04-19 20:38:39 -03:00
Carlos Antonio da Silva
df4b282566 Set variable to false instead of nil 2013-04-19 19:59:08 -03:00
Carlos Antonio da Silva
b8c5d76c5a Merge pull request #2380 from vipulnsward/fix_warnings
fix some warnings
2013-04-19 15:53:43 -07:00
Vipul A M
b871bd5036 fix some warning 2013-04-19 19:08:20 +05:30
José Valim
c439b80524 Merge pull request #2381 from vipulnsward/enable_warinings
enable warnings by default
2013-04-18 13:40:01 -07:00
Rafael Mendonça França
704221d48f Merge pull request #2379 from vipulnsward/remove_unused_vars
Remove unused variables and fix typos
2013-04-18 06:38:32 -07:00
Vipul A M
da70348662 enable warnings by default 2013-04-18 11:07:36 +05:30
Vipul A M
2e6457006e Remove unused variables and fix typos 2013-04-18 10:24:38 +05:30
Carlos Antonio da Silva
1f68309c47 ✂️ changelog [ci skip] 2013-04-15 15:50:06 -03:00
José Valim
c618969677 Update README.md 2013-04-14 08:49:30 -07:00
Lucas Mazza
93013c2e89 Merge pull request #2366 from hauleth/extract-lookup-for-i18n
Extract get_message
2013-04-14 08:21:19 -07:00
José Valim
8ec89bf659 Update README.md 2013-04-13 23:39:32 -07:00
José Valim
b3edfeab73 Update README.md 2013-04-13 23:35:58 -07:00
José Valim
c63483ae24 Merge branch 'latortuga-rails4-sp' into rails4 2013-04-13 23:34:25 -07:00
José Valim
3ed0dc5d9f Update README 2013-04-13 23:34:07 -07:00
José Valim
8a93c34080 Clean up Devise parameter sanitizer 2013-04-13 23:21:46 -07:00
José Valim
2dfa7e1761 Update CHANGELOG 2013-04-13 22:10:48 -07:00
José Valim
5bf4f57fcf Tidy up devise configuration 2013-04-13 22:07:54 -07:00
José Valim
1b8fd7c2ff Merge pull request #2271 from robhurring/master
Allowing http token auth to set the token_authentication_key if missing from params
2013-04-13 21:39:36 -07:00
Carlos Antonio da Silva
f75352a373 Merge branch 'master' into rails4 2013-04-13 11:37:48 -03:00
Carlos Antonio da Silva
fa5ae57ce4 Use instance_eval instead of Proc#bind
Keep the implementation more similar to how it works in Action Mailer,
and avoid deprecation warnings with Proc#bind being raised in rails4
branch.
2013-04-13 11:35:51 -03:00
Carlos Antonio da Silva
ac2ebdfb11 Fix session store changed in Rails master
There's no encrypted cookie store anymore, by default the cookie store
will be encrypted.
2013-04-13 11:16:11 -03:00
Carlos Antonio da Silva
ea94e199ce Bundle update 2013-04-13 11:14:13 -03:00
Carlos Antonio da Silva
d89dad5728 Bundle update for both Rails 3.1 and 3.2, update mocha, fix failing tests 2013-04-13 11:08:27 -03:00
Carlos Antonio da Silva
32a141d2a9 Fix typo in test descriptions 2013-04-13 10:54:52 -03:00
Carlos Antonio da Silva
36557ef641 ✂️ [ci skip] 2013-04-13 10:53:49 -03:00
José Valim
aa24335656 Merge pull request #2371 from tomasv/custom-devise-mailer-default-proc-fix
Fix devise sender bug with custom devise mailers.
2013-04-12 08:37:31 -07:00
Tomas Varneckas
1acd3d1790 Fix devise sender bug with custom devise mailers.
The devise sender detection must take into account that the default
sender set in the custom devise mailer can be a proc.
2013-04-12 16:48:48 +03:00
Drew Ulmer
d20fdf87b6 Introduce BaseSanitizer null sanitizer and controller-specific callbacks
This updates Devise's StrongParameter support to feature:

- A Null base sanitizer to support existing Rails 3.x installations that
  don't want to use StrongParameters yet
- A new, simpler API for ParameterSanitizer: #permit, #permit!, and #forbid
- Overrideable callbacks on a controller-basis, e.g. #create_sessions_params
  for passing the current scope's parameters through StrongParameters and
  a helper method, whitelisted_params, for rolling your own implementations
  of #create_x_params in your own controllers.
- Lots of tests!
2013-04-10 10:33:50 -05:00
Łukasz Niemier
95f56258d7 Rename get_message to find_message and fix set_flash_message 2013-04-07 08:52:11 +02:00
Łukasz Niemier
8e9ad4626e Extract get_message 2013-04-06 18:46:21 +02:00
José Valim
2de7cbae25 Merge pull request #2363 from eloyesp/documenting_protected_methods
Generate documentation for protected methods.
2013-04-04 06:52:08 -07:00
Eloy Espinaco
37473cdaf7 Add config to customize documentation. 2013-04-04 09:48:33 -03:00
Lucas Mazza
bf30d79aca Update rubygems url inside Gemfile.lock 2013-04-03 10:22:46 -03:00
José Valim
148fa99dce Merge pull request #2330 from pungoyal/master
Language copy changes
2013-04-01 12:20:02 -07:00
Drew Ulmer
77203e3d97 Change parameter sanitizer instance method to scope to devise
This way it's very explicit that this method is for devise and it won't
run into any naming collisions with user code.
2013-04-01 09:46:46 -05:00
Drew Ulmer
b151d2cfe2 Remove MassAssignment security from Mongoid test shim 2013-04-01 09:00:36 -05:00
Drew Ulmer
e0ffe8f85f Fix internal helper test referencing resource_params 2013-03-31 21:31:54 -05:00
Drew Ulmer
78f137368c Add support for Rails 4 strong_parameters
This brings support for Rails 4 StrongParameters changes.

- Parameter sanitizing is setup for Devise controllers via
  resource_params except Omniauth Callbacks which doesn't use
  resource_params.

- Change #build_resource to not call resource_params for get requests.
  Parameter sanitizing is only needed when params are posted to the
  server so there's no need to try to construct resource params on get
  requests (new, edit).
2013-03-31 21:31:48 -05:00
Drew Ulmer
af4a582300 Remove mass-assignment role-based tests, no longer supported in Rails 4
Mass-assignment security roles are removed in Rails 4 so there's no need
to test :as => :role behavior.
2013-03-31 15:21:49 -05:00
Drew Ulmer
2f88f7c0ed Remove protected_attributes gem and all whitelisting 2013-03-31 15:21:49 -05:00
Lucas Mazza
ce37c301ff Update Rails dependency 2013-03-31 17:19:10 -03:00
Lucas Mazza
bd14589fe4 Ensure that include_root_in_json is true since our test suite depends on that. 2013-03-31 17:18:41 -03:00
Lucas Mazza
c07bc69fad Install Mongoid in Ruby 2.0 2013-03-31 17:18:02 -03:00
Rafael Mendonça França
9a8cb011d7 Use the latests Rails version 2013-03-28 14:00:55 -03:00
Rafael Mendonça França
335a6af861 Merge branch 'master' into rails4 2013-03-28 13:51:12 -03:00
Vasiliy Ermolovich
72cbafa322 Merge pull request #2340 from scottjacobsen/master
s/reseting/resetting

[ci skip]
2013-03-22 00:17:20 -07:00
Scott Jacobsen
4549d8c65f Update recoverable.rb
Fix type-o.
2013-03-21 18:49:19 -06:00
Vasiliy Ermolovich
6c566c1ca4 Merge pull request #2331 from yxhuvud/master
License information to gemspec.
[ci skip]
2013-03-16 09:06:04 -07:00
linus
41aed807fc Add license to gemspec. 2013-03-16 09:29:46 +01:00
Puneet Goyal
ddea9359a6 Removing an extra full stop 2013-03-15 15:19:52 +05:30
Puneet Goyal
5d87e150f7 removing an extra full stop 2013-03-15 15:18:45 +05:30
José Valim
d90e365636 Merge pull request #2315 from neo/http_auth_key
Allow explicit configuration of http auth key
2013-03-07 09:43:08 -08:00
Lucas Mazza
22442907af Fix send_devise_notification arity in the documentation.
[ci skip]
2013-03-05 15:55:19 -03:00
robhurring
10f58b636f update devise config template with new allow_token_authenticatable_via_headers options 2013-03-04 17:38:36 -05:00
robhurring
2d14bd2826 removing params hash merging of token and mimicking http basic auth flow 2013-03-04 17:33:27 -05:00
Matt Jones + Tony Schneider
f4ceecece4 Allow explicit configuration of http auth key
- Fix basic auth case in which authorized_keys is configured as hash
- Duplicate existing functionality when http_auth_key is not explicitly
  set
2013-03-04 12:23:05 -05:00
José Valim
359fdd840c Merge pull request #2311 from pixeltrix/improve-delayed-email-documentation
Improve documentation on sending delayed emails
2013-03-01 06:49:39 -08:00
Andrew White
c6578250d2 Improve documentation on sending delayed emails
There are a couple of gotchas in the existing documentation
about the `send_devise_notification` hook.

1.  The `after_commit` callback can be called multiple times
    so you should clear the array otherwise any additional
    invocations will trigger extra copies of the email.

2.  The `after_commit` callback is only called when a record
    is created or updated so you need to check for `new_record?`
    or `changed?` before adding it to `pending_notifications`
    otherwise it's okay to send it immediately.

The `new_record? || changed?` condition is necessary because
the latter isn't always true for new records, e.g:

    >> User.new.changed?
    => false

[ci skip]
2013-03-01 14:32:15 +00:00
José Valim
dc14c76ff6 Merge pull request #2308 from vfrride/patch-1
updates source url to use https
2013-02-27 18:59:31 -08:00
vfrride
5e74fd406b updates source url to use https 2013-02-27 21:39:45 -05:00
José Valim
ebeee33429 Run image optimizer on the logo (i'm done) 2013-02-26 11:36:25 -07:00
José Valim
e449c3b6d2 Update badges 2013-02-26 11:27:58 -07:00
José Valim
58871172ab Crop the logo a bit more 💣 2013-02-26 11:25:26 -07:00
José Valim
41a2d65ade Reduce logo dimentions 2013-02-26 11:23:11 -07:00
José Valim
e6dc425abb Add Devise logo 2013-02-26 11:19:48 -07:00
Carlos Antonio da Silva
d29b744d92 Enable Ruby 2.0 in travis 2013-02-25 22:13:48 -03:00
Carlos Antonio da Silva
e79ebe8aec Fix last mongoid tests since it does not have the order method 2013-02-25 22:13:36 -03:00
Santiago Pastorino
10f93129c3 Rails 4 now raises ActionController::UrlGenerationError
This is the commit in Rails
https://github.com/rails/rails/commit/db06d128
2013-02-25 22:12:21 -03:00
Santiago Pastorino
04d9512f30 We need to do match via [get, post] 2013-02-25 22:12:20 -03:00
Santiago Pastorino
135c8da390 To be able to post to root via is now needed 2013-02-25 22:12:20 -03:00
Carlos Antonio da Silva
aca7e5d162 Run tests with mongoid 2013-02-25 22:12:20 -03:00
Carlos Antonio da Silva
02298117a0 Do not remove app/mailers from autoloaded paths 2013-02-25 22:12:06 -03:00
Carlos Antonio da Silva
7998d6f878 Match full template name 2013-02-25 22:12:06 -03:00
Vasiliy Ermolovich
ed6e232756 assert_recognizes rises Assertion instead of RoutingError 2013-02-25 22:12:06 -03:00
Carlos Antonio da Silva
567fabbbc6 Disable forcing whitelist attributes from protected attributes
This was the previous functionality since we didn't set anything in the
application configuration. Now when using protected attributes gem, it
sets whitelist to true, forcing us to always declare the accessible
attributes, and this is not the case for the Admin model.
2013-02-25 22:12:06 -03:00
Carlos Antonio da Silva
d77a956276 Remove AR deprecated finder warnings 2013-02-25 22:12:06 -03:00
Carlos Antonio da Silva
3c885e043d Fix changed error messages from confirmation validation 2013-02-25 22:12:06 -03:00
Carlos Antonio da Silva
9ae013ae3c Updating test app running rake rails:update, tests running with failures 2013-02-25 22:12:06 -03:00
Carlos Antonio da Silva
1bae64d8c4 Update dependencies for Rails 4 2013-02-25 22:11:49 -03:00
Carlos Antonio da Silva
f8792c8cf0 Update to Rails 3-2-stable and fix failing tests 2013-02-25 22:06:10 -03:00
Lucas Mazza
198bfff2de Merge pull request #2300 from fphilipe/scoped-serialization
Make use of warden's scoped serialization
2013-02-25 15:32:43 -08:00
Lucas Mazza
d3f0665105 Merge pull request #2305 from gregates/feature/skip_confirmation_notice!
Changelog for #2296
2013-02-25 15:31:56 -08:00
Greg Gates
77b960f14a Changelog for #2296 2013-02-25 18:23:43 -05:00
José Valim
b388aae473 Merge pull request #2302 from islandr/master
Mention devise-encryptable requirement in initializer template
2013-02-25 14:05:15 -08:00
José Valim
81c6d70b7c Merge pull request #2296 from gregates/feature/skip_confirmation_notice!
Add #skip_confirmation_notification! to Confirmable
2013-02-25 14:01:54 -08:00
Ryan Mohr
f3928d8462 Mention devise-encryptable requirement for anything but bcrypt. 2013-02-25 10:42:06 -10:00
Philipe Fatio
c22d755cf4 Make use of warden's scoped serialization 2013-02-25 07:38:42 +01:00
Greg Gates
72cfaad618 Add #skip_confirmation_notification to Confirmable 2013-02-22 12:43:01 -05:00
José Valim
22897150d8 Merge pull request #2278 from plataformatec/issue-2275
allow_unconfirmed_access_for set to nil means unconfirmed access for unlimited time
2013-02-14 11:30:51 -08:00
Vasiliy Ermolovich
395a69b4ef allow_unconfirmed_access_for set to nil means unconfirmed access for unlimited time
closes #2275
2013-02-13 21:17:38 +03:00
Rob
547439d94c renaming devise option "allow_authorization_to_set_auth_token" to "allow_token_authenticatable_via_headers" 2013-02-10 12:50:52 -05:00
Rob
84f743c4ef adding http token auth options to env[devise.token_options] 2013-02-10 12:48:02 -05:00
Rob
22a8cfe6d3 fix hanging line on method call 2013-02-09 15:19:42 -05:00
Rob
3025b7e2f7 Allow http token authorization to set token_authentication_key in place of passing it in via params
It will not override existing token_authentication_key params if they are present.
2013-02-09 15:12:36 -05:00
Vasiliy Ermolovich
1b2460171e Merge pull request #2261 from plataformatec/issue-2253
use scoped path to shared views if scope is present
2013-02-08 15:43:39 -08:00
Vasiliy Ermolovich
f822f92321 use scoped path to shared views if scope is present
closes #2253
2013-02-09 02:35:06 +03:00
Lucas Mazza
042ba76480 Merge pull request #2263 from sboesen/patch-1
Typo - Update lib/generators/templates/devise.rb
2013-02-06 17:08:36 -08:00
Stefan Boesen
3458e12274 Update lib/generators/templates/devise.rb
Typo in template comment.
2013-02-06 16:30:00 -08:00
José Valim
d9364f7a4a Update CHANGELOG.rdoc
Close #2254
2013-02-01 09:30:43 -07:00
José Valim
fd0db0b188 Merge pull request #2251 from latortuga/2190-test-case
Add test for Issue #2190
2013-02-01 07:58:00 -08:00
Drew Ulmer
c9c1e13743 Add test for Issue #2190
Seems to be passing for me.
2013-01-31 10:05:53 -06:00
José Valim
25296d8c6f Add tests for sign out with redirect, related to #2249 2013-01-30 08:28:51 -07:00
José Valim
34c7981f69 Merge pull request #2248 from bvsatyaram/patch-1
Update README.md
2013-01-30 07:11:43 -08:00
B V Satyaram
f7a658e13d Update README.md
Devise is composed of 11 modules instead of 12.
2013-01-30 15:17:36 +05:30
José Valim
1d639bd0c5 Merge pull request #2247 from waldyr/patch-1
correcting tiny typo
2013-01-29 17:01:04 -08:00
Waldyr Guimarães Araújo de Souza
5ee07390b7 correcting tiny typo 2013-01-29 22:45:23 -02:00
Carlos Antonio da Silva
83ad67bd51 Fix inheriting mailer templates from Devise::Mailer
Previously inheriting from Devise::Mailer would not render default views
from devise when the inheriting mailer didn't have the view. Now it'll
correctly pick the default one from Devise::Mailer.
2013-01-29 00:08:26 -02:00
Carlos Antonio da Silva
72be1f1289 Match against string value, no need to create regexps 2013-01-28 23:59:15 -02:00
Carlos Antonio da Silva
0285565322 Actually fix this test by forcing to_s on the id 2013-01-28 21:40:11 -02:00
Carlos Antonio da Silva
acc3adb2c1 Use #next instead of calculating id + 1
The id attribute is not Integer in Mongo, so it fails with something like:

    NoMethodError: undefined method `+' for "5106fc06ee6da1ee44000002":Moped::BSON::ObjectId'`

With #next, it will work with both Integer and String ids, for both AR
and Mongo, returning a different id to test for filtered conditions.
2013-01-28 20:46:21 -02:00
Carlos Antonio da Silva
af37800c1d Change match routes to get / post
match without a verb is deprecated in Rails master.
2013-01-28 20:23:13 -02:00
Carlos Antonio da Silva
86eecc6606 Change "ActionController::IntegrationTest" to "ActionDispatch::IntegrationTest" 2013-01-28 19:58:21 -02:00
Rafael Mendonça França
349aab72f0 No need to test against ree since we are testing with 1.8.7 2013-01-28 13:50:08 -02:00
Rafael Mendonça França
bfa65dde70 Use the Ruby 1.8 hash syntax.
Yes we still support Ruby 1.8 😢
2013-01-28 13:21:44 -02:00
José Valim
d099d8f0ac Release v2.2.3 2013-01-26 11:43:17 -07:00
José Valim
5190f52857 Require string conversion for all values 2013-01-26 11:42:42 -07:00
José Valim
5790107f49 Merge pull request #2235 from camelmasa/sorted_locale_file
sorted locale file
2013-01-22 19:11:38 -08:00
camelmasa
6fd21ae37e sorted locale file 2013-01-23 10:39:58 +09:00
Vasiliy Ermolovich
b95c321660 update Gemfile.lock 2013-01-21 20:14:59 +03:00
Alexander Zaytsev
01bb721c33 Use mapping.fullpath in omniauth callbacks 2013-01-21 19:51:06 +05:00
Carlos Antonio da Silva
0061f113db Fix indent [ci skip] 2013-01-20 21:49:45 -02:00
José Valim
1fb3fbbd88 Merge pull request #2230 from nashby/issue-2218
add key option to rememberable_options
2013-01-20 12:23:21 -08:00
Vasiliy Ermolovich
d3f8bd6cae add key option to rememberable_options
closes #2218
2013-01-20 23:16:25 +03:00
José Valim
0642e2fc9b Merge pull request #2223 from jayshepherd/master
Allow parent_mailer to be customizable via Devise.parent_mailer ... (#2219)
2013-01-18 05:35:55 -08:00
Jay Shepherd
cc017b1f0d Allow parent_mailer to be customizable via Devise.parent_mailer, useful for engines 2013-01-18 02:26:41 -06:00
José Valim
6c2f51e35e Release 2.2.2 2013-01-15 21:03:15 +01:00
Lucas Mazza
47db984f52 Apply the changes on 0c4615e33 to the simple_form template too. 2013-01-14 18:53:34 -02:00
José Valim
0c4615e337 Properly check if reconfirmable is available 2013-01-13 09:53:26 +01:00
Carlos Antonio da Silva
85e46f0163 Merge pull request #2211 from nashby/fix-build
uUe click_button for canceling account in integration specs
2013-01-12 03:16:12 -08:00
Vasiliy Ermolovich
9913fde749 use click_button for canceling account in integration specs 2013-01-12 14:12:05 +03:00
José Valim
1f940f61c6 Merge pull request #2210 from steverob/master
Changed link_to to button_to for cancel registration link in edit registration view
2013-01-11 14:25:55 -08:00
Steve Robinson
70e38fe66d Changed link_to to button_to for delete user
It is advisable to use link_to for mostly GET operations. Actions like DESTROY when presented as a link can cause severe vulnerabilities.
Hence using a button is advisable.
2013-01-12 01:53:09 +05:30
José Valim
872ef2b97f Release 2.2.1 with fixes for 2.2.0 regressions 2013-01-11 19:15:54 +01:00
José Valim
33fb89340a Revert "update_with_password doesn't change encrypted password when it is invalid"
This reverts commit 10235f9d72.
2013-01-11 19:12:53 +01:00
José Valim
bd9bf326c0 Merge pull request #2206 from tigris/mailer_subject_rename
Rename Devise::Mailer.translate() to something more inline with what it does
2013-01-10 04:19:57 -08:00
Danial Pearce
d48414b0a5 Rename Devise::Mailer.translate() to something more inline with what it does. 2013-01-10 15:26:06 +11:00
José Valim
b6a7d11e5a Merge pull request #2205 from latortuga/2204-regression-with-db-authenticatable
2204 regression with db authenticatable
2013-01-09 09:52:14 -08:00
Drew Ulmer
75ce916be9 Call respond_to?(attr) before applying strip or downcase
This avoids calling strip and downcase on globally configured keys that may
not exist on all devise models. Fixes #2204, a regression introduced by
PR #2135. Also included a note about the intentional use of respond_to.
2013-01-09 11:42:54 -06:00
Drew Ulmer
c768366240 Add failing tests for Issue #2204
For a point release upgrade, Devise should not throw an exception when trying
to downcase or strip globally configured keys. This would be a breaking
change in functionality and this test demonstrates the issue.
2013-01-09 11:41:20 -06:00
Lucas Mazza
ca7d479e90 Install mongoid only on 1.9 2013-01-09 11:51:15 -02:00
Rafael Mendonça França
5bfbc264b7 Invalid YAML 💣 2013-01-09 10:14:01 -02:00
Rafael Mendonça França
9f8d3db2b4 Notify on campfire 2013-01-09 10:11:24 -02:00
Lucas Mazza
4b0d161f95 Update Gemfile.locks to latest patch releases of Rails and fix mocha to 0.10.0.t 2013-01-09 10:01:25 -02:00
José Valim
b2b8b5bf9a Release v2.2.0 2013-01-08 21:30:43 +01:00
Carlos Antonio da Silva
beda0fe9bd Update copyright [ci skip]
Or as @rafaelfranca says: Happy New Year 🎆
2013-01-08 09:22:26 -02:00
José Valim
8fa3951bea Update app/controllers/devise/sessions_controller.rb 2013-01-06 11:07:51 +01:00
José Valim
9724e386c3 Merge pull request #2201 from al/bugfix-non_navigational_session_destroy
Fix bug with non-navigational requests being treated as navigational ones in XHR to SessionsController#destroy.
2013-01-06 02:07:16 -08:00
Alan Larkin
f2de7bf84c Fixed bug in SessionsController#destroy which caused all XHR requests, regardless of `Accept' header, to be treated as 'text/html'. 2013-01-06 03:50:26 +00:00
Alan Larkin
84b8188db9 Added failing integration test for XHR invocation of SessionsController#destroy with */*' in the Accept' header. 2013-01-06 03:49:59 +00:00
José Valim
19b5bcbe0f Accept mail options in Devise::Mailer and deprecate headers_for 2013-01-04 18:52:49 +01:00
José Valim
7c8f636b98 Merge pull request #2178 from gwagener/master
Improved grammar of reset password e-mail
2012-12-13 22:49:30 -08:00
Graham Wagener
5745d97232 Improved grammar of reset password e-mail. 2012-12-14 15:08:55 +13:00
José Valim
86f0bff332 Apparently Rails 3.1 does not like @headers as ivar 2012-12-13 09:59:36 +01:00
José Valim
30ab6f923d Release 2.2.0.rc 2012-12-13 09:20:46 +01:00
José Valim
839e8fc8ac Show if there is an e-mail waiting for confirmation, closes #2060 2012-12-13 09:13:33 +01:00
José Valim
4c83743263 unconfirmed_email now uses the proper e-mail on salutation, related to #2060 2012-12-13 09:02:59 +01:00
José Valim
e1fde192f2 Update CHANGELOG 2012-12-13 08:43:43 +01:00
José Valim
73389ea491 Merge pull request #2174 from rykov/master
Adding the Gem Version badge to README
2012-12-11 10:44:32 -08:00
Michael Rykov
eeb6a30752 Add 'Gem Version' badge to README.md 2012-12-11 10:39:47 -08:00
Lucas Mazza
01669c7374 Display the build status just for the master branch [ci skip]. 2012-12-10 10:59:50 -02:00
Carlos Antonio da Silva
ac3a25bf2e Remove nothing raised assertion
Let the test raise if that is the case, no need for assert that nothing
was raised.

Hopefully fix the build 
2012-12-04 17:49:26 -02:00
Carlos Antonio da Silva
0652117c79 Bundle update 2012-12-04 17:37:32 -02:00
Carlos Antonio da Silva
2261005ed5 Refactor a bit to avoid two model attributes lookup
Tidy up tests a bit.
2012-12-04 17:37:12 -02:00
José Valim
e80e0c9a89 Merge pull request #2135 from latortuga/2129-make-validatable-affect-virtual-attributes
Make validatable callbacks affect virtual attributes
2012-12-02 01:43:48 -08:00
Drew Ulmer
79e9d6e564 Allow validation callbacks to apply to virtual attributes 2012-12-01 21:06:33 -06:00
Drew Ulmer
0c6f2adf14 Add failing test for #2129 2012-12-01 21:06:11 -06:00
Drew Ulmer
77ec1b08cd Move test models into their own file so they can be used elsewhere 2012-12-01 21:06:03 -06:00
Carlos Antonio da Silva
2be9fb292e Merge pull request #2165 from asanghi/master
Reverting part of #2164 which was a mistake [ci skip]
2012-12-01 10:58:39 -08:00
Aditya Sanghi
88dba417ef reverting part of #2164 which was a mistake 2012-12-02 00:24:09 +05:30
José Valim
b98f021d0f Merge pull request #2164 from asanghi/master
Minor grammar updates
2012-11-30 03:25:51 -08:00
Aditya Sanghi
c026b5a3f6 minor documentation grammar update 2012-11-30 16:42:18 +05:30
José Valim
3696cbf33e Merge pull request #2148 from kukula/master
Fix default email_regexp config to not allow spaces
2012-11-21 02:58:30 -08:00
José Valim
cbfdcbeaed Merge pull request #2147 from gabetax/signin_nonexistent_error
Support alternate sign in error message when email record does not exist
2012-11-19 15:56:18 -08:00
Gabe Martin-Dempesy
130d684198 Change failure key for missing database resource to :invalid_email 2012-11-19 15:49:21 -08:00
Anatoliy Kukul
f0f3e15c08 add test for Devise.email_regexp 2012-11-19 17:38:22 +02:00
José Valim
19a1ea5211 Update README.md 2012-11-19 14:02:43 +01:00
José Valim
6c2c808478 Merge pull request #2143 from luisico/display-invalid-confirmation-token-error
Invalid confirmation token message not shown with simple_form
2012-11-19 05:02:06 -08:00
Anatoliy Kukul
adc9a45f05 Used other regxp 2012-11-19 13:58:19 +02:00
Anatoliy Kukul
50186474d4 Fix default email_regexp config to not allow spaces
Default email_regexp config accepted emails with spaces. e.g.: "test user@test server.com" http://rubular.com/r/jXGS8pmumd
Changed regexp to not allow spaces in email. e.g.:  http://rubular.com/r/tTD9PytGEp
2012-11-19 13:40:54 +02:00
Gabe Martin-Dempesy
ffab77c35e Fix typo on nonexistent error 2012-11-18 15:19:15 -08:00
Gabe Martin-Dempesy
cde2229e59 Support alternate sign in error message when email record does not exist
By default, the nonexistent error is still identical to the :invalid
message, and must be customized by the developer to implement.
2012-11-18 15:08:57 -08:00
José Valim
397fce1f9d Merge pull request #2144 from jm81/master
Use correct current_password in RegistrationTest of invalid confirmation
2012-11-15 10:56:49 -08:00
Jared Morgan
f044916f94 Use correct current_password in RegistrationTest of invalid confirmation
In DatabaseAuthenticatable#update_with_password, password is now deleted if
the current_password is invalid. dm-validations will not check the
confirmation in that case, so this test was failing in dm-devise.
2012-11-15 12:21:11 -06:00
Luis Gracia
0415564a7d Show invalid unlock token message
Attribute unlock token is not present in the simple_form template,
therefore not being displayed by #error_notification.
This fix explicitily call #full_error on :unlock_token.
2012-11-13 15:01:32 -05:00
Luis Gracia
ed6f2abc23 Show invalid confirmation token message
fixes #2143

Attribute confirmation token is not present in the simple_form template,
therefore not being displayed by #error_notification.
This fix explicitily call #full_error on :confirmation_token.
2012-11-12 20:05:42 -05:00
Lucas Mazza
96a0477555 Remove 1.9.2 + Mongoid from the build matrix.
http://mongoid.org/en/mongoid/docs/tips.html#ruby
2012-11-12 15:07:29 -02:00
Lucas Mazza
da5464acf6 Update Travis CI configuration:
* `DEVISE_ORM=mongoid` is part of the build matrix, except
  for 1.8.7 and REE rubies;
* `language` key added (Thanks to travis-lint).
2012-11-12 09:12:17 -02:00
Lucas Mazza
1c8fc18fad Update Gemfile.rails-3.1.x. 2012-11-12 09:11:55 -02:00
José Valim
fbf667e009 Update CHANGELOG 2012-11-10 21:07:34 +01:00
José Valim
071ba358a9 Update README.md 2012-11-10 20:51:20 +01:00
José Valim
ef4db2e93d Merge pull request #2138 from nashby/patch-1
update README
2012-11-10 11:49:15 -08:00
José Valim
6a2ef52aa0 Merge pull request #2139 from durran/mongoid-3-test-fixes
Fix spec failures for Mongoid 3.
2012-11-10 11:49:05 -08:00
Durran Jordan
d821275588 Fix spec failures for Mongoid 3.
This has no actual changes to Devise itself, just fixes the failing
tests when running against Mongoid 3 instead of Mongoid 2.

Mocha has been locked at 0.10.0 since 0.12.0 raises an error when trying
to set an expectation on a frozen object.

Tests were updated to work with both AR and Mongoid, some cases the XML
serialization was slightly different but both were outputting correct
and valid XML, and the id/_id field mismatch is now handled.

An active field was missing from the test models for Mongoid, and the
invalid :null => true options in field were removed.
2012-11-10 20:02:58 +01:00
Vasiliy Ermolovich
59966e817c update README
closes #2128
2012-11-10 20:35:43 +03:00
José Valim
b1df686a2e Merge pull request #2137 from nashby/indifferent
remove useless test
2012-11-08 11:25:08 -08:00
Vasiliy Ermolovich
ae426dcc1c remove useless test 2012-11-08 22:22:03 +03:00
José Valim
1646684af9 Merge pull request #2134 from marcinb/master
unlock user after password re-set
2012-11-07 14:15:00 -08:00
Marcin Balinski
ac58c28617 Unlock user when re-setting password and unlock strategy is :email or :both 2012-11-07 10:45:46 +01:00
José Valim
7d72121bd7 Merge pull request #2132 from nashby/issue-2130
update_with_password doesn't change encrypted password when it is invalid
2012-11-06 13:13:50 -08:00
Vasiliy Ermolovich
10235f9d72 update_with_password doesn't change encrypted password when it is invalid
closes #2130
2012-11-06 21:05:17 +03:00
José Valim
5d311e7557 Merge pull request #2126 from nashby/issue-2122
don't delete the return to url from session if the requested format is not navigational
2012-11-04 23:49:42 -08:00
Vasiliy Ermolovich
5d86327e4d move is_navigational_format? and request_format methods to helpers 2012-11-05 09:54:22 +03:00
Vasiliy Ermolovich
61903b534a don't delete the return to url from session if the requested format is not navigational
closes #2122
2012-11-04 23:42:38 +03:00
José Valim
ee61d86546 Update CONTRIBUTING.md 2012-10-30 20:09:10 +01:00
José Valim
06a2cff140 Merge pull request #2117 from nashby/fix-issue-2043
handle namespaced models in AR generator
2012-10-27 15:25:32 -07:00
Vasiliy Ermolovich
2f36d0dd32 handle namespaced models in AR generator
closes #2043
2012-10-28 00:59:33 +03:00
José Valim
d5a2a9b2da Update CHANGELOG 2012-10-26 11:24:56 +02:00
José Valim
8ee1591868 Merge pull request #2115 from latortuga/1994-paranoid-locking
Add failing test for Issue #1994
2012-10-26 02:22:49 -07:00
José Valim
18c377e0d7 Merge pull request #2112 from latortuga/patch-1
Make #set_flash_message respect i18n-set resource_name
2012-10-26 02:05:42 -07:00
Drew Ulmer
00a01c2bc4 Fix #1994 Lockable no longer leaks account existence 2012-10-25 16:51:56 -05:00
Drew Ulmer
00e8841e93 Unit test for Lockable#unauthenticated_message not leaking account existence
This is another failing test for #1994, a unit test for Lockable. Lockable's
#uanauthenticated_message should not return :locked if paranoid mode is on
and instead should return the generic :invalid response.
2012-10-25 16:51:02 -05:00
Drew Ulmer
f79bb31ee6 Add failing test for Issue #1994
Lockable should not leak information about account existence if paranoid
mode is on.
2012-10-25 16:20:21 -05:00
Drew Ulmer
d6449d014e Add test for #devise_i18n_options allowing resource_name override 2012-10-24 12:13:07 -05:00
Drew Ulmer
b853871667 Make #set_flash_message respect i18n-set resource_name
Using #devise_i18n_options allows overriding any i18n keys but the
resulting call to I18n.t does not respect an override of resource_name.
2012-10-24 11:50:26 -05:00
José Valim
f796439cf2 Merge pull request #2111 from rubynortheast/signup_hook
Separates sign_up and sign_in on Registration
2012-10-23 12:53:52 -07:00
Philip Poots
692175b897 Moves sign_up from helpers to controller 2012-10-23 20:29:41 +01:00
Philip Poots
68dc20cba2 Separates sign_up and sign_in on Registration
See #2104

Completed with the help of @rubynortheast
2012-10-23 20:05:45 +01:00
José Valim
90dbae4c7a Merge pull request #2096 from adammcnamara/bugfix/assign-self-dot-resource
Assigns object to self.resource, changing variable scope.
2012-10-10 07:10:22 -07:00
Adam McNamara
564e588f5e Assigns object to self.resource, changing variable scope. 2012-10-10 10:01:35 -04:00
José Valim
8f4b06542e Merge pull request #2088 from dyba/contributing-fix
Missing https:// in Google Group link
2012-10-04 08:44:20 -07:00
Daniel Dyba
7513512000 Missing https:// in Google Group link 2012-10-04 08:38:16 -07:00
José Valim
7b04ecdddb Update CONTRIBUTING.md 2012-10-04 08:20:50 -07:00
José Valim
50338b34f9 Merge pull request #2074 from diminish7/failure_app_test_helper
Test helper was incorrectly returning failure body
2012-09-28 07:45:49 -07:00
José Valim
75268bed5c Merge pull request #2077 from floehopper/use-number-of-for-countable-noun
Use "number of" instead of "amount of" for countable nouns.
2012-09-28 07:45:03 -07:00
James Mead
e873e2aeed Use "number of" instead of "amount of" for countable nouns. 2012-09-28 10:52:37 +01:00
Jason Rush
b27491061e Test helper was incorrectly returning failure body
The _process_unauthenticated method in test_helper was returning
the response as the body. When setting rendering the text, it was
calling to_s on the response which would render something like
this: #<ActionDispatch::Response:0x007fb9e1efea00>. This change
renders the body of the response instead of the response itself
2012-09-27 18:44:31 -06:00
José Valim
9e096a4113 Update README.md 2012-09-18 14:30:04 +03:00
José Valim
8c7bf7dd15 Merge pull request #2042 from igor04/master
Deleted unnecessary validation in generator mongoid model
2012-09-13 05:10:18 -07:00
José Valim
f7dd59839c Update lib/generators/templates/README 2012-09-06 17:26:20 +03:00
José Valim
84c4759f58 Merge pull request #2045 from mtoledo/patch-1
Minor typo fix
2012-08-28 04:17:53 -07:00
Marcos Toledo
e345d3940c Minor typo fix 2012-08-27 23:41:47 -03:00
igor04
d59301ed2a Deleted unnecessary validation in generator mongoid model 2012-08-26 14:54:08 +03:00
José Valim
48751783a7 Merge pull request #2040 from RudyOnRails/master
Corrected routes.rb comment for destroy_user_session HTTP method. From GET to DELETE.
2012-08-23 09:24:39 -07:00
Kevin Musiorski
691172d01f Changed HTTP method for route destroy_user_session from GET to DELETE. Cleaned up indentations to keep tidy. 2012-08-23 10:26:45 -05:00
José Valim
eb51d0365f Merge pull request #2037 from Radagaisus/master
HTML5 Autofocus, to make things nicer
2012-08-22 05:38:38 -07:00
Radagaisus
422bf89182 autofocus for simple_form_for 2012-08-22 15:28:25 +03:00
Radagaisus
4962fbcb51 no need for {} they said 2012-08-22 02:15:48 +03:00
Radagaisus
be2b481385 fixed for 1.8.7 syntax 2012-08-22 02:13:38 +03:00
Radagaisus
d169ef3641 extra whitespace 2012-08-22 02:01:01 +03:00
Radagaisus
2a64972321 html5 autofocus for a better ux from the get go 2012-08-22 01:58:26 +03:00
Rafael Mendonça França
33fac7f765 Merge pull request #2027 from nashby/patch-1
Update lib/devise/rails/routes.rb comments
2012-08-17 07:09:49 -07:00
Vasiliy Ermolovich
5c2e3e1a12 Update lib/devise/rails/routes.rb 2012-08-17 17:05:47 +03:00
José Valim
4a24667e80 Revert "Rails 3.2.7 deprecates update_attribute in favor of update_column"
Rails 3.2.8 is rolling back the deprecations.

This reverts commit 7d41072c0e.
2012-08-05 09:24:10 -03:00
José Valim
c3d9dc3007 Merge pull request #2007 from willrax/patch-1
fixed typo in readme.md
2012-08-05 04:48:35 -07:00
willrax
df0a9401b1 fixed typo in readme.md 2012-08-05 19:27:11 +10:00
Carlos Antonio da Silva
f7f086faae Fix README [ci skip] 2012-07-31 23:32:10 -03:00
Rafael Mendonça França
6ae64b1723 Merge pull request #1998 from fabiokr/update_attribute
Replaces update_attribute with update_column
2012-07-27 13:31:20 -07:00
Fabio Kreusch
7d41072c0e Rails 3.2.7 deprecates update_attribute in favor of update_column. Updated projects using Devise output lots of warnings because Devise uses the deprecated version in some places. This commit replaces update_attribute with update_column to fix that. 2012-07-27 17:25:21 -03:00
José Valim
2f75b12add Merge pull request #1993 from ahmeij/master
Add message about :timedout flash to the Readme (resolved #1777)
2012-07-25 07:25:37 -07:00
Andre Meij
352dd1f2fc Update README.md include :timedout notice
Resolves #1777
2012-07-25 16:47:40 +03:00
José Valim
bdf0bc7b1e Revert "Revert "New password default minimum length is now 8""
This reverts commit b1f490a2f8.
Actually, the implementation was good!
2012-07-24 23:41:17 +02:00
José Valim
b1f490a2f8 Revert "New password default minimum length is now 8"
This reverts commit 2950434ed3.
It is backwards incompatible, we need a better migration plan.
2012-07-24 22:41:13 +02:00
Víctor Manuel Cruz Dueñas
73f617db7b Checking if unconfirmed_email has changed before to set update_needs_confirmation flash message.
Conflicts:

	test/integration/registerable_test.rb

Signed-off-by: José Valim <jose.valim@plataformatec.com.br>
2012-07-23 16:20:51 +02:00
José Valim
1da8490dbc Add a note about APIs in token authenticatable, closes #1959 2012-07-23 16:12:38 +02:00
José Valim
6e79c5c242 Ensure a new token is generated if the previous one expired 2012-07-23 16:05:51 +02:00
José Valim
f4db03d31c Do not add ActionView::Helpers::DateHelper to all models 2012-07-23 15:59:17 +02:00
Rodrigo Flores
8bc1096099 Minor correction on changelog 2012-07-23 10:39:39 -03:00
Rodrigo Flores
a23247d431 Changelog 2012-07-22 17:17:50 -03:00
Rodrigo Flores
6a37945025 Merge pull request #1975 from promisedlandt/email-token-expiration
Email token expiration
2012-07-22 13:10:27 -07:00
Nils Landt
dcada8fe75 Refactor according to line notes from josevalim
- rename reset_password_within to confirm_within
- confirmation_period_valid? is back and memoized
- fix hash syntax to hashrocket
2012-07-22 14:02:27 +02:00
Nils Landt
f80cecc864 Remove unnecessary include 2012-07-16 11:50:46 +02:00
Nils Landt
1d6ee13aae Refactor according to rodrigoflores
- Favor using update_attribute instead of constructor parameters in user
  factory for tests
- Test for accurate error message when confirmation token is expired
- Don't check twice whether the confirmation period is expired
2012-07-16 11:20:01 +02:00
José Valim
01d3ed7172 Merge pull request #1976 from benknowles/master
Patch for Trackable IP
2012-07-12 12:15:36 -07:00
Ben Knowles
a1411c885f Trackable should use the remote IP address, not the gateway's 2012-07-12 13:34:31 -05:00
Nils Landt
6e48fcee76 Fix tests for email token expiration
The tests work now, but are a bit wonky because User.create does things
I don't understand.
2012-07-11 18:30:36 +02:00
Nils Landt
42a0c30139 Refactored according to line notes by rodrigoflores 2012-07-11 15:49:41 +02:00
Nils Landt
87f2fa9767 Add options to expire confirmation tokens
With this patch, functionality is added to expire the confirmation
tokens that are being sent by email.
For example, if a token is valid for 3 days only, it cannot be used for
confirmation on the 4th day.
2012-07-09 14:43:12 +02:00
José Valim
8463c6dce4 Merge pull request #1963 from shime/master
update CONTRIBUTING.md
2012-07-07 11:38:41 -07:00
Hrvoje Šimić
9b77ac0cab update CONTRIBUTING.md 2012-07-07 19:57:59 +02:00
Rodrigo Flores
0afae74386 Update CONTRIBUTING.md 2012-07-06 16:52:53 -03:00
José Valim
56c1ab0824 Update CONTRIBUTING.md 2012-07-06 20:39:39 +02:00
José Valim
1ec23994f2 Try CONTRIBUTING.md 2012-07-06 20:23:58 +02:00
Rodrigo Flores
2950434ed3 New password default minimum length is now 8 2012-07-06 13:41:28 -03:00
Rodrigo Flores
1aca139c65 Changelog update 2012-07-06 12:03:25 -03:00
Rodrigo Flores
fa451306fc Merge pull request #1961 from carlosgaldino/change-min-password-length
Change the minimum password length to 8
2012-07-06 08:01:41 -07:00
Carlos Galdino
c179cef365 Change the minimum password length to 8 2012-07-06 11:46:46 -03:00
Víctor Manuel Cruz Dueñas
3511f8ac00 Checking if unconfirmed_email has changed before to set update_needs_confirmation flash message. 2012-07-05 19:10:34 +02:00
José Valim
1579ec9a87 Update CHANGELOG 2012-06-28 12:13:42 +02:00
José Valim
cbc6926e3d Fix issue #1928, thanks to @ejfinneran for a test case 2012-06-28 12:05:20 +02:00
José Valim
9678b422ff Merge pull request #1954 from mrchrisadams/d1bf31729d10fbb65f1b7ce158f3926aa946b3ad
Allow setting of default reply_to fields on mailer mails - #1936
2012-06-27 03:19:52 -07:00
Chris Adams
d1bf31729d Address issue #1936
Update mailer to accept reply_to as a default param as well, as discussed in 

https://github.com/plataformatec/devise/issues/1936#issuecomment-6583637
2012-06-26 23:11:35 +01:00
José Valim
a89a2052b8 Depend on latest warden 2012-06-26 21:16:00 +03:00
José Valim
6c80839e7b Merge pull request #1953 from ka8725/master
Use request_format method instead of direct code
2012-06-26 11:12:18 -07:00
Andrey Koleshko
972ac3b5f0 refactor is_navigational_format? method 2012-06-26 17:58:50 +03:00
Rodrigo Flores
caa8961938 Merge pull request #1949 from dblock/reconfirmation_token_reset
Test that confirms that #1948 is not an issue.
2012-06-25 15:37:05 -07:00
dblock
619826fbc8 Test that confirms that #1948 is not an issue. 2012-06-25 18:33:48 -04:00
José Valim
fe62d1bf6a Merge pull request #1943 from mathieul/patch-1
Allow to destroy a session using JSON format
2012-06-24 07:25:25 -07:00
mathieul
95f20587ef test that destroying a session doesn't set the flash if the requested format is not navigational 2012-06-23 14:43:35 -07:00
Mathieu Lajugie
8171ad39e0 Allow to destroy a session using JSON format (or any non navigational format) when Rails flash feature is not enabled (i.e.: when using rails-api). 2012-06-23 10:49:33 -07:00
Carlos Antonio da Silva
0c9b79947d Fix locked_at column in lockable required fields logic
See a7658f9d75 (commitcomment-1493199)

Thanks @nickhoffman
2012-06-22 22:31:57 -03:00
Carlos Antonio da Silva
4c9680787d Merge pull request #1941 from saizai/patch-1
Camelize correctly - e.g. omniauth-paypal sets this via OmniAuth.config.add_camelization
2012-06-22 18:21:14 -07:00
Sai
6eeb9e4b7d Update patch-1 2012-06-22 14:03:56 -03:00
Sai
80b2240ef0 Camelize correctly - e.g. omniauth-paypal sets this via OmniAuth.config.add_camelization 2012-06-22 10:55:23 -03:00
José Valim
2f142724c5 Update master 2012-06-19 19:33:30 +03:00
José Valim
174c2903d7 Release 2.1.2 2012-06-19 11:27:30 +02:00
José Valim
1f4c8e39f8 Revert "Thor fixes were sent upstream"
Actually, we need to wait for a new rails release, le sigh.

This reverts commit 3caab6d2ea.
2012-06-18 15:18:33 +02:00
José Valim
3caab6d2ea Thor fixes were sent upstream 2012-06-18 15:06:06 +02:00
José Valim
4e5a9bd600 Workaround thor bug /cc @wycats 2012-06-18 13:44:43 +02:00
José Valim
fef34d360b Merge pull request #1924 from calmyournerves/patch-1
fixed typo "Depreation" -> "Deprecation"
2012-06-16 11:00:38 -07:00
calmyournerves
05ddd9c204 fixed typo "Depreation" -> "Deprecation" 2012-06-16 20:51:56 +03:00
José Valim
ba2e44c6a4 Release 2.1.1 2012-06-16 15:57:17 +02:00
José Valim
4f07ed42e3 Lock warden on sign out 2012-06-16 15:21:48 +02:00
José Valim
66716023e4 Disable storage on CSRF 2012-06-16 14:51:37 +02:00
José Valim
4bc2ff997a Timeout does not explode when reset_authentication_token! is accidentally defined by Active Model 2012-06-16 14:04:34 +02:00
José Valim
b1633f2454 Delegate omniauth_authorize_path to the router, closes #1843 2012-06-16 13:43:11 +02:00
José Valim
41a91188f5 Do not trigger timeout on sign in related actions 2012-06-16 13:24:07 +02:00
José Valim
4def600076 Mark some methods as private 2012-06-16 13:06:52 +02:00
José Valim
18a18e4c72 Provide a send_devise_notification hook 2012-06-16 13:00:51 +02:00
José Valim
85c90671bc Update CHANGELOG 2012-06-16 12:38:02 +02:00
José Valim
16b688eced Merge pull request #1922 from excid3/master
Flexible routing scopes
2012-06-15 11:21:21 -07:00
Chris Oliver
37c55eb192 Added tests for flexible routing constraints 2012-06-15 13:06:29 -05:00
Chris Oliver
2d7dc3e82d Merge branch 'master' of git://github.com/plataformatec/devise 2012-06-15 11:05:58 -05:00
Chris Oliver
e7a8a7247c Switch and, or to &&, || 2012-06-15 08:45:44 -05:00
José Valim
c4818a9fb2 Reorganize tests slightly 2012-06-15 11:15:03 +02:00
Chris Oliver
8c2a7146df Add scope into warden user access 2012-06-15 02:10:42 -05:00
Chris Oliver
311e3206c9 Added block to authenticate route as well 2012-06-15 00:12:09 -05:00
Chris Oliver
6ad6b3d2a6 Allow passing a block to the authenticated route 2012-06-14 23:54:12 -05:00
Carlos Galdino
471a05fd59 Merge pull request #1921 from nashby/data-confirm
use data-confirm option as :confirm was deprecated in rails 3.2.6
2012-06-14 12:50:02 -07:00
Vasiliy Ermolovich
7a12655111 use data-confirm option as :confirm was deprecated in rails 3.2.6
SimpleForm templates
2012-06-14 22:48:37 +03:00
Rafael Mendonça França
1b26869b74 Merge pull request #1920 from nashby/data-confirm
use data-confirm option as :confirm was deprecated in rails 3.2.6
2012-06-14 12:35:30 -07:00
Vasiliy Ermolovich
13f35d80a9 use data-confirm option as :confirm was deprecated in rails 3.2.6 2012-06-14 22:27:40 +03:00
José Valim
1c4faa7d8a Depend on latest orm adapter 2012-06-13 15:07:24 +02:00
José Valim
c26ed53927 Merge pull request #1908 from mhfs/lockable_async_fix
Persist unlock token before triggering mailer
2012-06-11 14:09:24 -07:00
Marcelo Silveira
fe0f6e96b3 Persist unlock token before triggering mailer 2012-06-11 17:52:10 -03:00
José Valim
6dd7ccee68 Add more docs, remove 3.0 related code, update CHANGELOG 2012-06-08 19:22:14 +02:00
José Valim
9327cf8af5 Merge pull request #1903 from zamith/master
Routes for engines
2012-06-08 10:05:56 -07:00
Zamith
512b52e23a Adding option to change omniauth path prefix 2012-06-08 17:50:33 +01:00
José Valim
5df7105301 Merge pull request #1902 from gbataille/master
Redirect to sign_in page when trying to access password#edit without a reset password token
2012-06-08 01:19:05 -07:00
Gregory Bataille
a84fdb771f Merge branches 'master' and 'no_token' 2012-06-08 10:08:50 +02:00
Gregory Bataille
ff75341c75 Redirect to sign in page when trying to access password#edit without a
reset_password_token (i.e. not coming from a reset password email)
2012-06-08 10:08:35 +02:00
Carlos Antonio da Silva
f0d48a96ca Fix rdoc rake task [ci skip] 2012-06-07 22:48:15 -03:00
José Valim
215fdf119e Better error message when mapping can't be found 2012-06-07 14:34:13 +03:00
José Valim
985b646ee1 Update README.md, closes #1895 2012-06-07 14:31:43 +03:00
José Valim
622e480c4b Merge pull request #1892 from clody69/master
Fixed User model generation for Mongoid
2012-06-07 01:09:54 -07:00
José Valim
2e78a46c52 Merge pull request #1896 from Antiarchitect/patch-1
In addition to #1722. expire_auth_token_on_timeout added to Timeoutable configuration block.
2012-06-07 01:09:05 -07:00
Andrey Voronkov
b1b6e53d6f In addition to #1722. expire_auth_token_on_timeout added to Timeoutable configuration block. 2012-06-07 09:32:44 +04:00
José Valim
65325f7f81 Merge pull request #1894 from wtn/master
#update_with_password should use mass assignment options when password is not valid
2012-06-05 01:15:51 -07:00
William T Nelson
9bd82e5a24 use mass assignment options when password is not valid 2012-06-04 22:52:09 -05:00
Claudio Riva
0689b4558e Update master 2012-06-03 22:24:31 +03:00
Rafael Mendonça França
dbea934701 Update README.md [ci skip] 2012-05-29 17:28:57 -03:00
Rafael Mendonça França
8e4d5fb38f Merge pull request #1882 from GeekOnCoffee/patch-1
URLs that aren't links aren't nice
2012-05-29 13:26:56 -07:00
Andrew Hooker
e324ee9823 URLs that aren't links aren't nice 2012-05-29 15:24:34 -05:00
José Valim
54e9cabf5d Update README.md 2012-05-29 16:46:58 +03:00
José Valim
7a3f6fb53d Merge pull request #1880 from brynary/codeclimate-badge
Add Code Climate badge to README
2012-05-29 05:54:49 -07:00
Bryan Helmkamp
59a9576498 Add Code Climate badge to README 2012-05-29 08:46:48 -04:00
José Valim
57eb3886ba Refactor router.rb a bit based on Code Climate feedback: https://codeclimate.com/github/plataformatec/devise/Devise 2012-05-29 11:29:09 +02:00
Rafael Mendonça França
fe9e6db0e2 Merge pull request #1876 from shaliko/master
Remove not used variables
2012-05-26 09:36:30 -07:00
Shaliko Usubov
db8eeb6c6e Remove not used variables 2012-05-26 20:31:42 +04:00
José Valim
2b7328535d Check for the request before checking for the mapping, closes #1859 2012-05-25 09:39:50 +02:00
José Valim
d4e5424360 Simplify validation logic inside strategies 2012-05-22 14:10:06 +02:00
José Valim
d67d992749 Merge pull request #1865 from nirvdrum/patch-1
Simple compose VS comprise grammar fix.
2012-05-21 03:33:57 -07:00
Kevin Menard
b6c7aafe55 Simple compose VS comprise grammar fix. 2012-05-20 23:04:53 -03:00
José Valim
9829384829 Merge pull request #1864 from nashby/update-views
use implicit partials rendering and update simple_form templates
2012-05-20 12:17:19 -07:00
Vasiliy Ermolovich
1d79c1982a use implicit partials rendering
make simple_form templates consistent with templates
that generates by simple_form itself

612c0067cf
2012-05-20 22:01:11 +03:00
José Valim
f6259531c3 Update CHANGELOG.rdoc 2012-05-17 13:25:07 +03:00
José Valim
ed03039d19 Merge pull request #1857 from pomnikita/master
Remove devise/schema from autoloads
2012-05-17 02:27:30 -07:00
Nikita Pomyashchiy
b6abc4623b Remove autoload of deprecated devise/schema 2012-05-17 13:13:19 +04:00
Carlos Antonio da Silva
d1949b7b42 Fix indent, remove not used variable 2012-05-15 17:22:52 -03:00
Carlos Antonio da Silva
b6e30427a3 Pass the block argument straight to the assertion methods in test helpers 2012-05-15 17:19:21 -03:00
Carlos Antonio da Silva
96e0dcf5d5 Remove not used variable, fix indent 2012-05-15 17:14:05 -03:00
Carlos Antonio da Silva
ab48435211 Remove warning with shadowing variable 2012-05-15 15:27:46 -03:00
Carlos Antonio da Silva
8bcb05d6c0 Cache constant on check fields 2012-05-15 15:20:01 -03:00
Carlos Antonio da Silva
6b363d6af9 Build only one model instance for checking fields 2012-05-15 15:12:18 -03:00
Carlos Antonio da Silva
2fd2a8662d Define the accessor right away instead of open + send 2012-05-15 15:05:21 -03:00
Rodrigo Flores
f1db0809b1 Bumping to 2.1.0 2012-05-15 14:14:41 -03:00
Rodrigo Flores
30ca072f50 Fixing README to reflect 2.1.0 release 2012-05-15 14:14:40 -03:00
José Valim
85ea53198a Merge pull request #1853 from adzap/master
Add resource_params controller method as helper to allow overriding params used to build resource
2012-05-15 01:21:18 -07:00
Adam Meehan
7ec4c1424d Add resource_params internal helper to param filtering
In light of recent discussions around mass assignment security and
the alternate solution of using the controller to filter params, not the model,
a hook/helper is needed to be able to override how the params are filtered
before they are used to build the resource.
2012-05-15 18:07:02 +10:00
Rodrigo Flores
f95513e86b Merge branch 'asanghi-fixes' 2012-05-14 17:53:52 -03:00
Rodrigo Flores
8baacecdcf Fixing tests 2012-05-14 17:53:34 -03:00
Aditya Sanghi
ff6e30cec4 Minor updates suggested to default language in locales. Be consistent with "email" and "e-mail"; email address exists "in" our database not "on" our database. 2012-05-14 17:44:51 -03:00
Rodrigo Flores
308275c8a8 Fixing a phrase on README 2012-05-14 10:37:30 -03:00
Rodrigo Flores
5ed6534aa3 Adding a line break on resource generator after attr_accessible
Fixes issue #1851
2012-05-14 10:26:30 -03:00
Rodrigo Flores
120ca0e3a5 Merge branch 'fork-readme-rdoc-links' 2012-05-10 10:40:38 -03:00
Hosam Aly
d193802613 Added links to module RDocs, except for Encryptable which I couldn't find. 2012-05-10 10:40:27 -03:00
Rodrigo Flores
50b4d2eb6b Removing mentioning encryptable on README 2012-05-10 10:29:34 -03:00
Rodrigo Flores
36db032ca0 Updated Gemfile.lock 2012-05-09 19:54:09 -03:00
Rodrigo Flores
afbcc31c6a Bumping version to 2.1.0.rc2 2012-05-09 19:53:38 -03:00
Rodrigo Flores
52c35b18da Updating README 2012-05-09 19:52:56 -03:00
José Valim
454a5ad1ec Try to fix the build for rails 3.1 2012-05-09 23:41:05 +02:00
Rodrigo Flores
1698f0f57c Merge branch 'removing_encryptable' 2012-05-09 18:05:14 -03:00
Rodrigo Flores
bb6d7334d0 Fixing gem name 2012-05-09 18:04:40 -03:00
Rodrigo Flores
659ec4d6ea Using bundler's awesome way to release the gem! 2012-05-09 14:59:42 -03:00
Rodrigo Flores
2e50204700 Changelog 2012-05-09 14:52:47 -03:00
Rodrigo Flores
39dc9a7ba6 Removed encryptable references on rails_app 2012-05-09 14:49:55 -03:00
José Valim
65ef2592f6 Add a test case to previous commit 2012-05-09 18:27:44 +02:00
José Valim
ad0aed3ba5 Alternative solution to failure app's script name handling (tests upcoming) 2012-05-09 18:03:23 +02:00
Rodrigo Flores
0d868b9ec1 Removed ENCRYPTORS_LENGTH 2012-05-09 08:42:37 -03:00
Rodrigo Flores
5f440dfe13 Removing encryptors and its autoloads 2012-05-07 16:50:35 -03:00
Rodrigo Flores
768f8832b9 Removing encryptable module 2012-05-07 16:37:16 -03:00
José Valim
32f20dddd6 Get rid of deprecated code 2012-05-06 13:13:53 +02:00
José Valim
7aa93a3ecb Update CHANGELOG 2012-05-06 12:53:27 +02:00
José Valim
b07dd76453 Remove faux bcrypt encryptor from Devise (it was never released and it wont be until we solve the encryptable issue 2012-05-06 12:49:53 +02:00
José Valim
4600b4ab22 Speed up bcrypt handling 2012-05-06 12:29:03 +02:00
José Valim
a8d2dce563 Merge branch 'test_helpers' 2012-05-06 12:19:36 +02:00
José Valim
5e845ee265 Do not reproduce warden behavior, simply rely on the controller calling it 2012-05-06 12:09:53 +02:00
Matt Connolly
a9b7a4a1de Reinstating tests for the controller test's response object. This does need to be set so the strategy's custom response can be tested. 2012-05-06 19:24:57 +10:00
Matt Connolly
32d2f78239 Updating process unauthenticated to set the response so it can be tested. 2012-05-06 18:41:43 +10:00
Matt Connolly
2a3a8b8008 Changing test to not bother with saved response, since it wasn't set by the test. 2012-05-06 17:08:00 +10:00
Matt Connolly
90a63d4d89 Completing test and functionality for TestHelper to correctly return a custom response from a warden strategy. 2012-05-06 16:48:39 +10:00
Matt Connolly
66f74ed579 Adding a test for a warden strategy retuning a custom response. 2012-05-06 13:35:24 +10:00
José Valim
d376d11d42 Merge pull request #1825 from julianvargasalvarez/master
Use 'head :no_content' in sessions_controller#destroy
2012-05-03 00:27:21 -07:00
Julian Vargas
6664acd27f Use 'head :no_content' in sessions_controller#destroy
Code cleanup for returning headers instead of an empty string
when destroying sessions.

Lines 464 and 471 on test/integration/autenticatable_test.rb
were adjusted to assert on :no_content
2012-05-02 22:40:53 -05:00
Rodrigo Flores
525bcd4e2d Refactoring simulation inside engine to decide based on the api 2012-05-02 14:53:14 -03:00
Rodrigo Flores
34a64070ca Cached the class_path and changed a variable name (kudos to @britto!) 2012-05-02 14:52:55 -03:00
José Valim
67f2074c81 Merge pull request #1805 from rosenfeld/deserialization-handling
Better handling of previously enabled Devise model deserialization
2012-05-02 10:34:28 -07:00
José Valim
e6717e3d68 Merge pull request #1823 from plataformatec/bugfix-engine-generator
Fixes generator on engine
2012-05-02 10:33:54 -07:00
Rodrigo Flores
271eac7381 Testes passing on 3.1 \o/ 2012-05-02 14:15:42 -03:00
Rodrigo Flores
4bf4036bf7 Upgrading Rails 3.1 to 3.1.4 2012-05-02 14:15:42 -03:00
Rodrigo Flores
22c210c8b9 Changelog 2012-05-02 14:15:42 -03:00
Rodrigo Flores
afc3888391 Generators on engine fix 2012-05-02 14:15:42 -03:00
Rodrigo Rosenfeld Rosas
411b565cca Better handling of previously enabled Devise model deserialization 2012-05-02 13:03:34 -03:00
Carlos Antonio da Silva
f6c06ac786 Use sqlite3 gem for 3.1 Gemfile 2012-04-27 18:42:03 -03:00
Rodrigo Flores
852a6ff175 Merge pull request #1813 from Agis-/patch-1
Break the line so it doesn't exceed 80-chars limit
2012-04-27 07:55:58 -07:00
Agis Anastasopoulos
d6f4d936ee Apply the 80 chars per-line rule 2012-04-27 17:51:07 +03:00
Carlos Antonio da Silva
cba1820168 Change Copyright also in license file [ci skip]
See d435118 for the readme change.
2012-04-24 08:54:01 -03:00
Carlos Antonio da Silva
0cfc88d2ee Merge pull request #1804 from rosenfeld/sqlite
sqlite3-ruby was renamed to sqlite3
2012-04-22 06:12:35 -07:00
Carlos Antonio da Silva
ec3eed5d2a Change method name 2012-04-22 10:07:44 -03:00
Carlos Antonio da Silva
49873f4fea Merge pull request #1796 from mkremer/feature/devise_redirects
Added after_sending_reset_unlock_instructions_path_for
2012-04-22 05:44:50 -07:00
Rodrigo Rosenfeld Rosas
ee29bf8d42 sqlite3-ruby was renamed to sqlite3 2012-04-18 15:31:25 -03:00
Mark Kremer
0e0bfe6686 Added after_unlock_path_for to allow override of redirect after account
unlock
2012-04-17 13:38:50 +02:00
Mark Kremer
fafea15fa8 Added after_sending_reset_unlock_instructions_path_for which can be overridden in extensions to modify the redirect path 2012-04-17 10:04:06 +02:00
José Valim
3752981cfa Merge pull request #1794 from aderyabin/master
Clean up global namespaces
2012-04-16 09:14:36 -07:00
Andrey Deryabin
9ec1003f1e removed global namespaces 2012-04-16 21:27:16 +07:00
Rodrigo Flores
64c99bcfd4 Updated changelog to include the removal of render_with_scope
Closes #1737
2012-04-09 16:42:30 -03:00
George Guimarães
d4351183d9 Changes link in copyright notice to Plataformatec's site 2012-04-09 09:37:35 -03:00
José Valim
cef5c93bca Merge pull request #1780 from cmeiklejohn/master
Verify AR constant is defined in test suite.
2012-04-08 08:59:39 -07:00
Christopher Meiklejohn
eb4e23274d Ensure ActiveRecord is defined, which is not true when running Mongoid tests. 2012-04-07 15:54:00 -03:00
José Valim
dacdc72581 Do not accidently mark _prefixes as private. 2012-04-05 09:18:59 -03:00
José Valim
6846014def Do not make _prefixes private. 2012-04-05 09:15:48 -03:00
Rodrigo Flores
07ef99a8f0 Changelog and a minor change on the test title 2012-04-04 17:27:41 -03:00
Rodrigo Flores
857af600f7 Merge pull request #1722 from Antiarchitect/master
Token regeneration on session timeout.
2012-04-04 13:23:27 -07:00
Carlos Antonio da Silva
3cbced4e4e Merge pull request #1776 from bloudermilk/patch-1
Fixes syntax highlighting in the "Getting started" section of the README
2012-04-04 11:09:03 -07:00
Brendan Loudermilk
85e4a0e6ec Fixes syntax highlighting in the "Getting started" section of the README 2012-04-04 11:03:24 -07:00
Rodrigo Flores
45aca40f6c Updating the README since we won't have more private messages on Github 2012-04-04 08:12:12 -03:00
Andrey Voronkov
7ecbba089f Authentication token expiration on session timeout 2012-04-02 20:48:23 +04:00
José Valim
205ddfb7c9 Merge pull request #1761 from rosenfeld/patch-7
Fix require for rememberable strategy
2012-03-31 04:21:19 -07:00
Rodrigo Rosenfeld Rosas
8a50b207eb Fix require for rememberable strategy 2012-03-31 08:17:16 -03:00
José Valim
9f99ccdca3 Merge pull request #1759 from rosenfeld/patch-6
Fix typo
2012-03-30 12:38:58 -07:00
Rodrigo Rosenfeld Rosas
f49b605514 Fix typo 2012-03-30 16:37:23 -03:00
José Valim
52b4bab461 Fix failing test. 2012-03-30 09:13:28 +02:00
José Valim
f1ccaf86a4 Remember token is not required. 2012-03-30 09:08:00 +02:00
José Valim
b59ce51760 Wording. 2012-03-30 09:05:52 +02:00
José Valim
60d2c6fddb Update docs to make find_for_authentication purpose more clear. 2012-03-30 09:00:03 +02:00
José Valim
25a563119b Revert "Merge pull request #1754 from pivotalhalogen/master"
find_for_authentication should be called during only during
an authentication process.

This reverts commit a4c9d5826d, reversing
changes made to f94b71038e.
2012-03-30 08:53:35 +02:00
Rodrigo Flores
a4c9d5826d Merge pull request #1754 from pivotalhalogen/master
Shiny new pull request for #1752
2012-03-29 19:34:55 -07:00
Josh Knox & Ken Mayer
1d3b89458e Fix Authenticatable, call find_for_authentication 2012-03-29 16:27:41 -07:00
José Valim
f94b71038e Merge pull request #1749 from rosenfeld/patch-5
config.use_salt_as_remember_token is no longer supported
2012-03-28 23:47:42 -07:00
Rodrigo Rosenfeld Rosas
076f4b4db1 config.use_salt_as_remember_token is no longer supported 2012-03-28 19:29:41 -03:00
José Valim
18829a56e4 Merge pull request #1745 from rosenfeld/patch-3
Fix minor typo on settings template
2012-03-28 13:05:03 -07:00
Rodrigo Rosenfeld Rosas
ac7b1b3c1f Fix minor typo on settings template 2012-03-28 16:58:21 -03:00
José Valim
b74f71fbed Fix build so it works with Rails 3.1. 2012-03-26 18:50:39 +03:00
José Valim
c3c0f4bd89 Update CHANGELOG.rdoc 2012-03-26 18:01:21 +03:00
José Valim
e860ade718 Merge pull request #1730 from Paymium/issue-1729
Fix for #1729
2012-03-26 07:59:17 -07:00
José Valim
e9a8c6cb62 Merge pull request #1738 from parndt/patch-1
Bumped orm_adapter requirement up to ~> 0.0.7 per ianwhite/orm_adapter#10
2012-03-25 04:41:22 -07:00
Philip Arndt
473a68dbf9 Bumped orm_adapter requirement up to ~> 0.0.7 per ianwhite/orm_adapter#10 2012-03-26 00:16:01 +13:00
David FRANCOIS
885d8836d1 Ability to use attr_protected attributes as sign-in keys without triggering ActiveModel::MassAssignmentSecurity::Error when ActiveRecord::Base.mass_assignment_sanitizer is set to :strict. Fixes #1729. 2012-03-21 11:48:00 +01:00
José Valim
e92ae37dc3 Merge pull request #1726 from plataformatec/failed_attempts
Setting failed_attempts to 0 after sign in
2012-03-19 14:09:23 -07:00
Rodrigo Flores
e6af9763fd Hook should be on lockable not recoverable and removed an useless comment 2012-03-19 18:06:20 -03:00
Rodrigo Flores
ca73dae1f0 Changelog 2012-03-19 17:15:32 -03:00
Rodrigo Flores
3623215b8c failed_attempts is set to 0 on sign in 2012-03-19 17:09:22 -03:00
Rodrigo Flores
a1376ac8ea Indentation + Typo 2012-03-16 22:06:43 -03:00
Rodrigo Flores
9d724cb72a OMG Forgot to update the Changelog 2012-03-15 11:23:01 -03:00
Rodrigo Flores
91ba14e77e Bumping to 2.1.0.rc 2012-03-15 11:16:11 -03:00
José Valim
2cab75d72b Merge pull request #1719 from hakanensari/mounted-app-redirect
Fix redirect when authenticating mounted apps
2012-03-15 00:15:02 -07:00
Hakan Ensari
b37a74533d Fix redirect when authenticating mounted apps 2012-03-15 02:41:29 +00:00
Rodrigo Flores
939d0f25c5 Merge pull request #1716 from plataformatec/validate_symbol
Validate is now a boolean function and unautheticated_symbol returns the symbol
2012-03-13 12:07:13 -07:00
Rodrigo Flores
61929d2e2f Fixing lockable to use the correct method 2012-03-13 15:53:57 -03:00
Rodrigo Flores
a7658f9d75 Checking required fields on lockable 2012-03-13 15:50:13 -03:00
Rodrigo Flores
033e91b7b9 Adding symbols only on validate 2012-03-13 14:24:21 -03:00
José Valim
68de34c03e Move valid_password? up to database authenticatable. 2012-03-10 11:10:57 +01:00
José Valim
94c05e346d Merge pull request #1709 from plataformatec/extracting_bcrypt
Moved BCrypt logic to a Encryptor
2012-03-09 14:26:20 -08:00
Rodrigo Flores
45298c0a37 Fixing some arguments order 2012-03-09 19:19:20 -03:00
Rodrigo Flores
c12fc1afea The signature must be the same 2012-03-09 18:37:37 -03:00
Rodrigo Flores
136b5b0be9 Added compare to encryptors 2012-03-09 17:19:36 -03:00
Rodrigo Flores
9203651110 Moved BCrypt logic to a encryptor 2012-03-09 16:38:06 -03:00
José Valim
a394ceaef1 Update CHANGELOG. 2012-03-09 18:12:43 +01:00
José Valim
0ab28ef8ee Add skip_reconfirmation! , closes #1708 2012-03-09 18:12:30 +01:00
Rodrigo Flores
b928b8b3a2 Merge pull request #1700 from strzalek/patch-1
Fix formatting in README
2012-03-05 08:19:02 -08:00
Łukasz Strzałkowski
075fc96f10 Fix formatting in README 2012-03-05 17:01:46 +01:00
Rodrigo Flores
15f6255c7c Update CHANGELOG.rdoc 2012-03-03 16:41:24 -03:00
Rodrigo Flores
2b79519ad1 Changelog 2012-03-03 15:25:07 -03:00
Rodrigo Flores
617a8876a6 Merge branch 'deprecating-ausence-of-required-fields' 2012-03-03 15:16:07 -03:00
Rodrigo Flores
7b7af57813 Minor fixes on models_test 2012-03-03 15:10:17 -03:00
Rodrigo Flores
a12f6ec70c Failure is better than exceptions 2012-03-03 14:49:59 -03:00
Rodrigo Flores
fffc3b1e0e Moved a method to support 2012-03-03 14:41:22 -03:00
Rodrigo Flores
af12ec2b01 Fixing a deprecation warning 2012-03-03 14:32:53 -03:00
Rodrigo Flores
ecfc7d752a Deprecation warning on module doesn't have a required_fields method 2012-03-03 14:30:59 -03:00
Rodrigo Flores
bc096994b0 Merge pull request #1696 from plataformatec/reverting
Adding back links partial to shared
2012-03-03 07:05:04 -08:00
Rodrigo Flores
ba80074b7b Added a missing hide! 2012-03-03 11:32:58 -03:00
Rodrigo Flores
f04d883ac1 Deprecation warning 2012-03-03 11:12:30 -03:00
Rodrigo Flores
9bf718dd82 Revert "Move devise/shared/_links.erb to devise/_links.erb"
This reverts commit aa2d15aa33.

Conflicts:

	CHANGELOG.rdoc
2012-03-03 10:40:59 -03:00
Rodrigo Flores
643d5600b2 Changelog adjustments 2012-03-03 08:41:23 -03:00
Rodrigo Flores
1edae9c6c1 Changelog update 2012-03-03 08:39:24 -03:00
José Valim
b41e5f5bf6 Update CHANGELOG 2012-03-03 12:11:40 +01:00
José Valim
2f6ecc1328 Do not call after sign in hook without resource, closes #1666. 2012-03-03 12:09:26 +01:00
José Valim
b93288875f Update lib/devise/rails/routes.rb 2012-03-03 11:16:21 +01:00
Rodrigo Flores
bb4f699d03 Fixing two tests 2012-03-03 01:25:17 -03:00
Rodrigo Flores
f1d991fa8b Merge pull request #1681 from abevoelker/change-omniauth-flash-wording
Change OmniAuth flash wording (authorize->authenticate)
2012-03-02 20:16:54 -08:00
Rodrigo Flores
4ce7854f44 Changelog 2012-02-25 10:38:40 -02:00
Rodrigo Flores
5ef35ee1bd Adding required_fields to all modules 2012-02-24 20:57:58 -02:00
Rodrigo Flores
6d5bccc050 Added required fields to validatable 2012-02-24 20:57:58 -02:00
Abe Voelker
3ac2c1dd18 Change OmniAuth flash wording (authorize->authenticate) 2012-02-24 14:35:43 -06:00
Carlos Antonio da Silva
07a41ecf6f Merge pull request #1679 from codeodor/patch-1
Include note about restarting the rails app if it's already running
2012-02-23 15:57:44 -08:00
Sammy Larbi
61e85a578e Include note about restarting the rails app if it's already running, because the last 2 apps I used Devise with, I could not figure out why I was getting very strange errors, and finally today I figured out it was due to the fact that it needed to reload. 2012-02-23 17:37:13 -06:00
José Valim
88d68587e1 Update lib/devise/controllers/helpers.rb 2012-02-23 21:06:39 +01:00
Rodrigo Flores
23ae04e6cb Merge pull request #1675 from plataformatec/fix_assertion
Fix the assert_same_content assertion helper
2012-02-22 10:51:05 -08:00
Lucas Mazza
64c05f2ce9 Fix the assert_same_content assertion helper
and a broken confirmable test.
2012-02-22 16:49:09 -02:00
José Valim
c5cb60a752 Merge pull request #1673 from plataformatec/check_attributes_rebased
Check attributes on models
2012-02-22 08:07:16 -08:00
Rodrigo Flores
803e4f5524 Changed message and refactored exception to use a initializer 2012-02-22 13:55:06 -02:00
Rodrigo Flores
a909bfaf85 Added required_fields when reconfirmable 2012-02-22 13:55:06 -02:00
Rodrigo Flores
bc11e9f300 One exception to rule them all 2012-02-22 13:55:05 -02:00
Rodrigo Flores
e3412d4207 No need to sort anymore 2012-02-22 13:55:05 -02:00
Rodrigo Flores
faf8b01ecc Fixing some tests and adding an assert message 2012-02-22 13:55:05 -02:00
Rodrigo Flores
d7337c5b26 Added a missing test and asserting same content for 1.8 compatibility 2012-02-22 13:55:05 -02:00
Rodrigo Flores
2ab1086b80 Test, you shall pass! 2012-02-22 13:55:05 -02:00
Rodrigo Flores
85f2f88c59 Added required fields to lockable 2012-02-22 13:55:05 -02:00
Rodrigo Flores
ce3422e75a Added required_fields to recoverable 2012-02-22 13:55:04 -02:00
Rodrigo Flores
bee87843b4 Added required_fields to rememberable 2012-02-22 13:55:04 -02:00
Rodrigo Flores
18aef6ac33 Some refactor 2012-02-22 13:55:03 -02:00
Rodrigo Flores
890f6031c3 Required fields on trackable 2012-02-22 13:55:03 -02:00
Rodrigo Flores
f3bace570d Required fields on token_authenticatable 2012-02-22 13:55:02 -02:00
Rodrigo Flores
533511f8c3 Required fields on encryptable 2012-02-22 13:55:02 -02:00
Rodrigo Flores
6489354b0e Required fields on confirmable 2012-02-22 13:55:02 -02:00
Rodrigo Flores
1bbae013cc ✂️ whitespaces 2012-02-22 13:55:02 -02:00
Rodrigo Flores
8ac8129fe7 Added required_fields to database_authenticatable 2012-02-22 13:55:01 -02:00
Rodrigo Flores
9667a38bc9 Added check_model! method 2012-02-22 13:55:01 -02:00
José Valim
e3df7f033e Update .travis.yml 2012-02-21 08:47:28 +01:00
José Valim
989fd92b84 Merge pull request #1672 from RogerE/rememberable_options-in-initializer
Use rememberable_options instead of deprecated cookie_options in initializer
2012-02-20 23:10:57 -08:00
RogerE
de24170a79 Use rememberable_options instead of deprecated cookie_options in initializer 2012-02-21 08:01:17 +01:00
José Valim
5a0548621f Remove deprecated examples from README, closes #1669. 2012-02-20 18:53:45 +01:00
Rafael Mendonça França
0f8e472dab Update CHANGELOG.rdoc 2012-02-18 14:24:49 -02:00
George Guimarães
b190fa38c7 typo 2012-02-17 19:15:46 -02:00
José Valim
b0b01dae81 Update CHANGELOG. 2012-02-17 12:51:00 +01:00
José Valim
f2b4ba6110 Release 2.0.4 2012-02-17 12:46:31 +01:00
José Valim
d15d0ba6a5 Update CHANGELOG. 2012-02-17 12:46:31 +01:00
José Valim
fc3af50b55 Fix regression where warden was being configured too early. 2012-02-17 12:46:31 +01:00
José Valim
a0a141b457 Merge pull request #1661 from mreinsch/fix_subdomain_routing
fix for when using :host in routes
2012-02-17 02:31:14 -08:00
Michael Reinsch
0315ca2701 fix for :host getting overwritten in scope[:options] and thus not generating URLs with correct hostnames 2012-02-17 19:14:42 +09:00
Rodrigo Flores
9f4f973277 Bumping new version 2012-02-16 16:07:10 -02:00
Rodrigo Flores
b825e16e36 Merge branch 'issue-solving' 2012-02-16 16:01:59 -02:00
Rodrigo Flores
24b4db4352 Added Gemfile.rails-3.1.x.lock 2012-02-16 15:53:22 -02:00
Rodrigo Flores
06941ac7a2 Updating gemfile to use the new warden version 2012-02-16 15:49:16 -02:00
Rodrigo Flores
91d0360a11 Changelog 2012-02-16 15:34:41 -02:00
Rodrigo Flores
17bae5bba2 Executing all sign_out function regardless of logged in users presence 2012-02-16 15:30:12 -02:00
Rodrigo Flores
1a41fff009 Bye PathChecker 2012-02-16 15:25:06 -02:00
Rodrigo Flores
7739c495e7 Any? instead of !empty? 2012-02-16 15:22:10 -02:00
Rodrigo Flores
5607f7a2c8 Updating Rails 3.1 gemfile 2012-02-16 15:08:47 -02:00
Rodrigo Flores
2a74416d68 Documentation update 2012-02-16 14:53:11 -02:00
Rodrigo Flores
65f08ea175 Removing signed_out path workaround 2012-02-16 14:53:11 -02:00
Rodrigo Flores
70b9bdcc9a Adding temporary dependency to warden master 2012-02-16 14:53:11 -02:00
Rodrigo Flores
584d5d1a81 Adding the api changes on sign_out_all_scopes 2012-02-16 14:53:10 -02:00
Rodrigo Flores
9e7ab38bce sign_out helper uses the new warden api 2012-02-16 14:53:10 -02:00
José Valim
71f5a01b83 Update CHANGELOG. 2012-02-16 12:31:04 +01:00
José Valim
df8ac1cfe6 Clean up remember token related config. 2012-02-16 12:30:04 +01:00
José Valim
72b6a0a0c9 Another attempt to avoid false positives in this warning. 2012-02-16 08:01:03 +01:00
José Valim
93cf836564 Avoid false positives for warning message. 2012-02-15 23:39:36 +01:00
José Valim
d2223ee5e3 Improve coverage, cache array in a constant. 2012-02-15 20:18:52 +01:00
José Valim
b6ab8d6776 Update lib/devise/models/authenticatable.rb 2012-02-15 20:05:18 +01:00
José Valim
456989ca8d Simply blacklist Devise attributes instead of trying to be smart. 2012-02-15 19:52:10 +01:00
José Valim
2e27d1f763 Update CHANGELOG, release 2.0.2 2012-02-15 17:26:23 +01:00
José Valim
27a83f3dd3 Ensure Devise.available_router_name is never nil, closes #1648 2012-02-15 17:13:57 +01:00
José Valim
79aadb4bc9 Set autocomplete to off by default on password field. 2012-02-15 17:07:58 +01:00
José Valim
43d0715238 Better error message in case a trackable module can't be saved. 2012-02-15 17:07:46 +01:00
José Valim
fb8e093389 Accept devise_i18n_options to handle custom i18n values, closes #1633 2012-02-15 16:58:23 +01:00
José Valim
4b47c3ab73 Clean up devise_controller? related code. 2012-02-15 16:58:23 +01:00
José Valim
a0eff85d73 Use ResourceHelpers so we get a warning in case someone passes a plural name, closes #1651. 2012-02-15 16:58:23 +01:00
Rodrigo Flores
aa36719bd9 Merge branch 'ysiadf-integrating' 2012-02-13 18:24:38 -02:00
Ysiad Ferreiras
33aa71c38f Update lib/generators/templates/README 2012-02-13 18:24:11 -02:00
Ysiad Ferreiras
1f20d7da25 Update lib/generators/templates/README 2012-02-13 18:23:45 -02:00
Ysiad Ferreiras
dfcf825721 Update README.doc to specify adding devise to the Gemfile. 2012-02-13 18:23:07 -02:00
José Valim
eaae041b4c Merge pull request #1635 from sj26/test-helpers-process-should-return-response
Fix test behaviour for rspec subject requests
2012-02-11 22:32:35 -08:00
Samuel Cochran
dbd79746b1 Fix test behaviour for rspec subject requests 2012-02-10 21:42:20 +08:00
José Valim
f1a27b8f33 Release 2.0.1. 2012-02-09 11:11:12 +01:00
José Valim
86c8e5455a Fix gemspec to not include tmp or log files, closes #1632. 2012-02-09 11:07:03 +01:00
José Valim
dc37b82298 Show a warning message in case routes are not mounted in the main app. 2012-02-07 10:56:30 +01:00
José Valim
7d09b84ded Split send_on_create_confirmation_instructions, closes #1621 2012-02-03 17:35:55 +01:00
José Valim
53894e1e2b Better exception message. 2012-02-03 17:29:22 +01:00
José Valim
7e3ccbe835 Better implementation for hide! 2012-02-03 09:12:15 +01:00
José Valim
8b8b6a866d Hide internal generators, closes #1586 2012-02-03 09:04:05 +01:00
Rodrigo Flores
222e606f89 Added a documentup link on README 2012-02-03 00:39:28 -02:00
José Valim
83c47552e8 Extract auth_options into its own method. 2012-02-01 09:37:33 +01:00
José Valim
03851cab90 Update lib/devise/rails/routes.rb 2012-02-01 07:26:39 +01:00
Carlos Antonio da Silva
bb6d89bbc3 Change README do markdown 2012-01-30 18:58:04 -02:00
José Valim
b061f985cf Update README to remove reference to old migration helpers. 2012-01-27 19:43:47 +01:00
José Valim
ecd7c17ffd Improve the message for case_insensitive_keys. 2012-01-27 17:53:44 +01:00
José Valim
a71a352822 Release 2.0.0 2012-01-26 19:40:04 +01:00
José Valim
c08c921b3f Update README.rdoc 2012-01-26 18:19:02 +01:00
Carlos Antonio da Silva
95399f1286 2012 [ci skip]
Hope we can do the same bump next year :)
2012-01-24 19:35:14 -02:00
José Valim
b5fd15c2e1 Let's show the default values for convenience. 2012-01-24 17:34:18 +01:00
José Valim
85e9dab370 Release 2.0.0.rc2. 2012-01-24 14:29:26 +01:00
José Valim
8c9cf7d671 Add deprecations, update changelog. 2012-01-24 14:23:34 +01:00
José Valim
82da877863 Merge pull request #1565 from joliss/unconfirmed-message
More helpful sign-up message for Confirmable
2012-01-24 05:06:51 -08:00
José Valim
275c480f89 Redirect to the previous URL on timeout, closes #1596 2012-01-24 14:00:36 +01:00
José Valim
477d9fbcba Do not fallback to string on failure app, easier for debugging, closes #1587 2012-01-24 13:46:25 +01:00
José Valim
b88524027c Get rid of deprecation warning. 2012-01-24 13:41:19 +01:00
José Valim
55be93d5c4 Deprecated support for nested devise_for blocks 2012-01-24 13:40:04 +01:00
Jo Liss
c78c196423 More helpful sign-up message for Confirmable
This is also better for translations, because we can translate paragraph-wise.

signed_up_but_inactive and signed_up_but_locked are likely not needed,
but I wasn't sure how to best remove them.
2012-01-23 13:52:32 +01:00
José Valim
d8656427fd Merge pull request #1591 from kaleemullah/master
fix unlock message
2012-01-23 03:29:29 -08:00
Kaleem Ullah
41b1e87105 fix unlock message 2012-01-23 15:20:05 +04:00
José Valim
37678ac5ec Merge pull request #1588 from nashby/fix-travis-build
fix travis build
2012-01-23 02:46:24 -08:00
Vasiliy Ermolovich
7832d90077 fix travis build 2012-01-22 22:12:28 +03:00
José Valim
3bd78cabd8 Update to 3.2.0 2012-01-20 19:03:22 +01:00
José Valim
fff75b1904 Merge pull request #1579 from masterkain/patch-1
Fix typos in devise.rb
2012-01-17 14:18:10 -08:00
Claudio Poli
97c0339f66 Fix typos in devise.rb 2012-01-17 23:14:26 +01:00
Rafael Mendonça França
5b3f14df3b Fix README 2012-01-17 15:59:50 -02:00
José Valim
07cdba349d Merge pull request #1563 from asynchrony/handle_regexp_param_filtering
Allow regex to avoid string conversion for parameter filtering
2012-01-16 03:20:17 -08:00
José Valim
197e837e5b Merge pull request #1564 from pcantrell/patch-1
Grammar fix.
2012-01-11 23:09:17 -08:00
pcantrell
13bd4ce46a Grammar fix. 2012-01-11 23:18:04 -06:00
José Valim
a43d1af23e Merge pull request #1557 from plataformatec/rails-3-2-fixes
Rails 3.2 fixes
2012-01-10 12:26:58 -08:00
Rafael Mendonça França
cbf483143f Remove rubinius from travis-ci matrix 2012-01-10 11:59:59 -03:00
Rafael Mendonça França
cf5fbb9d65 Fix order specific test 2012-01-10 11:59:20 -03:00
Rafael Mendonça França
d699b80254 Do not use a local network ip as HTTP_X_FORWARDED_FOR header
If HTTP_X_FORWARDED_FOR is a local network IP the HTTP_CLIENT_IP
need to be set
2012-01-10 11:43:15 -03:00
Rafael Mendonça França
ead414d0a7 Use global Gemfile in travis-ci 2012-01-10 10:52:14 -03:00
Rafael Mendonça França
cfdabf874a Change gemspec to avoid subshells and remove unneeded files
More informations at http://tenderlovemaking.com/2011/12/05/profiling-rails-startup-with-dtrace/
2012-01-09 23:47:35 -03:00
Rafael Mendonça França
e954254abb Fix gemfiles 2012-01-09 23:18:03 -03:00
Rafael Mendonça França
93d4bb8361 Add travis-ci specific gemfiles 2012-01-09 22:59:13 -03:00
Rafael Mendonça França
edb0aac091 Whitespaces ✂️ 2012-01-09 18:11:10 -03:00
Rafael Mendonça França
9549a32500 Do not use deprecated ActiveSupport::Base64. Closes #1554 2012-01-09 18:10:49 -03:00
José Valim
a949f9eca2 FailureApp shuold always consider Devise.router_name, closes #1544 2012-01-03 20:32:51 +01:00
Carlos Antonio da Silva
f4bbad6323 Merge pull request #1543 from joliss/doc
Improve routing API docs
2012-01-03 06:39:41 -08:00
Jo Liss
8a4d4864ea Improve routing API docs 2012-01-03 15:33:19 +01:00
José Valim
a8de38d0b0 Fix http://@ from CHANGELOG 2012-01-02 23:18:57 +01:00
José Valim
18dc82c6b6 add a test that :module => :devise overrides previous configs. 2012-01-02 22:47:28 +01:00
José Valim
897c1c684e Allow router_name to be customizable via Devise.router_name, useful for engines 2012-01-02 22:43:07 +01:00
José Valim
1ebcb09fc1 Do not rely on root_path. Redirect to / if not available. 2012-01-02 22:43:07 +01:00
José Valim
0f11226ced Merge pull request #1540 from michaelklishin/master
Bring .travis.yml up to date
2012-01-02 13:21:51 -08:00
José Valim
dada404a6b Support 3.2 as well. 2012-01-02 22:19:05 +01:00
Michael Klishin
e4a37d6a5e Bring .travis.yml up to date
* rbx and rbx-2.0 are now both aliases for rbx-18mode (master in 1.8 mode)
 * 1.9.3 final is available
2012-01-03 01:14:59 +04:00
José Valim
66b93e8fd2 Clean up as we don't need to call render_with_scope anymore. 2012-01-02 22:12:09 +01:00
José Valim
d9df632671 Get rid of InternalHelpers, refactor scoped views for more performant behavior. 2012-01-02 22:01:28 +01:00
José Valim
aa2d15aa33 Move devise/shared/_links.erb to devise/_links.erb 2012-01-02 21:26:26 +01:00
José Valim
0b55ebb150 Remove 3.0 related code. 2012-01-02 21:04:54 +01:00
José Valim
7c11564613 Remove Rails 3.0 only code. 2012-01-02 20:43:39 +01:00
José Valim
c3f864f2b6 Allow parent controller to be customizable. 2012-01-02 20:39:22 +01:00
José Valim
a29a30effc Move InternalHelpers to parent controller. 2012-01-02 20:30:56 +01:00
José Valim
0af2722926 Let's depend on 3.1 forward. 2012-01-02 20:24:42 +01:00
José Valim
78efec09d5 Move notes to the top. 2012-01-02 20:24:42 +01:00
José Valim
1fdeadd113 Merge pull request #1188 from sj26/controller-inheritence
Make all controllers inherit from a single DeviseController
2012-01-02 11:24:33 -08:00
José Valim
a1464dbad7 Replace github.com/ by @ 2012-01-02 20:16:40 +01:00
José Valim
dd2a66d00c Update CHANGELOG. 2012-01-02 20:16:11 +01:00
José Valim
1152fda687 Only proxy to application controller if it exists. 2012-01-02 20:00:38 +01:00
José Valim
fd0e929087 Generate session routes for token authentication, but mark it as no_input. 2012-01-02 19:38:02 +01:00
José Valim
8b3e0e52f1 Generate routes again for token, closes #1526. 2012-01-02 19:27:05 +01:00
José Valim
8ff080fb99 Improve docs for params/http authenticatable. 2012-01-02 19:24:48 +01:00
José Valim
6bca228888 Merge pull request #1527 from joliss/generator
Use consistent number of hash signs
2012-01-02 10:21:41 -08:00
José Valim
fd1e588645 Merge pull request #1534 from jigyasa/master
Fix for a bug: Incorrect message for locked account
2012-01-02 10:04:17 -08:00
José Valim
024d9e6df7 Merge pull request #1537 from nashby/fix-issue-1530
regenerate confirmation token on reconfirmation
2011-12-31 04:03:14 -08:00
Vasiliy Ermolovich
aca8d3f34c regenerate confirmation token on reconfirmation, closes #1530 2011-12-31 14:22:58 +03:00
Jigyasa Makkar
e2030a740d Fixed a bug in lockable wherein when a user tries to login with correct password after being locked,
failed attempts count gets reset. When the user tries to login with an incorrect password next,
the message shown is for invalid password instead of locked account since this check
depended mainly on failed attempts count.
2011-12-29 23:57:39 +05:30
Jo Liss
27b745d04f Use consistent number of hash signs 2011-12-28 17:26:57 +01:00
José Valim
f712d07b23 Merge pull request #1516 from jm81/master
Move "include Devise::Models::Authenticatable" inside devise_modules_hook! call
2011-12-20 14:00:36 -08:00
Jared Morgan
f8ea5e0942 move include Devise::Models::Authenticatable inside devise_modules_hook! call
This allows alternate ORMs to run compatibility setup code before
Authenticatable is included.

The particular issue for dm-devise is that DataMapper does not have a
before_validation method, which is called when Authenticatable is included
(as of plataformatec/devise@bd27bf76). dm-devise adds before_validation in
it's devise_modules_hook!
2011-12-20 15:52:26 -06:00
José Valim
89db0dd44d Do not run validatins unless on reconfirmable branch, closes #1515. 2011-12-20 20:54:49 +01:00
José Valim
94e5a589b6 Update README.rdoc 2011-12-19 13:35:54 +01:00
José Valim
2dbb23f973 Update README.rdoc 2011-12-19 13:34:31 +01:00
José Valim
b71028dc73 Add a note to the README. 2011-12-19 13:33:33 +01:00
José Valim
f5aab14766 Release Devise 2.0.0.rc. 2011-12-19 13:31:24 +01:00
José Valim
273c5e99c1 Add space between messages. 2011-12-19 13:30:33 +01:00
José Valim
7ba37b5dc0 Improve messages. 2011-12-19 13:21:17 +01:00
José Valim
059d3856cf Update CHANGELOG. 2011-12-19 12:58:34 +01:00
José Valim
9dbd265fdd Update messages. 2011-12-19 12:55:41 +01:00
José Valim
09ae63f822 Update CHANGELOG.rdoc 2011-12-19 12:32:32 +01:00
T1D
c9becd3ea1 Allow regular expressions to avoid string conversion for parameter
filtering.
2011-12-14 10:41:24 -06:00
José Valim
5a245b3d55 Merge pull request #1508 from spagalloco/patch-1
Fixed gemnasium link in README to link to the web page and not the image
2011-12-12 13:57:06 -08:00
Steve Agalloco
7d3b16fe73 Fixed gemnasium link in README to link to the web page and not the image 2011-12-12 15:08:13 -05:00
José Valim
fd85b25d29 PathChecker should not attempt to validate invalid routes, closes #1505 2011-12-12 11:35:41 +01:00
José Valim
5eebf74f69 Fix a bug where passing :format => false to devise_for was permanent, closes #1504 2011-12-12 09:25:19 +01:00
José Valim
5a11c6597c Usage of Devise.stateless_token= is deprecated in favor of appending :token_auth to Devise.skip_session_storage 2011-12-11 20:39:41 +01:00
José Valim
930b324c15 Usage of confirm_within was deprecated in favor allow_unconfirmed_access_for 2011-12-11 20:18:02 +01:00
José Valim
d952dea32b Remove the code that was dynamically adding columns to active record 2011-12-11 20:07:50 +01:00
José Valim
9a6ac7ab69 Add confirmable to admin. 2011-12-11 20:07:50 +01:00
José Valim
df43ee640d Add Gemfile back to repository. 2011-12-11 20:07:50 +01:00
José Valim
309b57f4ea Merge pull request #1496 from laserlemon/patch-1
Add dependency status to README
2011-12-10 14:29:36 -08:00
José Valim
cc839caba5 Update CHANGELOG, rename method. 2011-12-10 23:28:23 +01:00
Steve Richert
d734648b15 Add dependency status to README 2011-12-09 15:46:52 -05:00
José Valim
006400905b Merge pull request #1493 from nashby/fix-issue-1486
redirect users to sign in page after unlock, closes #1486
2011-12-08 11:13:24 -08:00
Vasiliy Ermolovich
1e1e964d25 redirect users to sign in page after unlock, closes #1486 2011-12-08 22:06:09 +03:00
José Valim
263e0b7692 Fix failing test. 2011-12-07 13:23:55 +01:00
José Valim
01d4d0131b Merge pull request #1489 from dmitriy-kiriyenko/fix_delegator
Fix taking associated failure app from the scope in the given env.
2011-12-07 04:12:26 -08:00
Dmitriy Kiriyenko
f41e4befde Fix taking associated failure app from the scope in the given env.
There is a delegator to get failure app, introduced in 4629bee and tuned
in 24b26026. The latter commit introduced a bit of logic, however, no
tests are included into commit. Needless to say this resulted in a
broken code.

The point is that `env["warden.options"][:scope]` returns a string.
However, `Devise.mappings` is a hash with symbol keys.

Adding tests and converting scope to symbol here.
2011-12-07 14:09:00 +02:00
Rodrigo Flores
94fca31be8 Improving the unconfirmed message 2011-12-06 09:24:06 -02:00
Rodrigo Flores
19db459fca typo 2011-12-06 08:35:02 -02:00
José Valim
7693173ecd Final tidy up on removing schema helpers. 2011-12-05 12:17:02 +01:00
José Valim
a0294cbae8 Improve fields. 2011-12-05 12:02:25 +01:00
José Valim
1cf008cbe3 Remove apply schema from mongoid as well. 2011-12-05 11:48:27 +01:00
José Valim
87b84ffded Remove schema fields from Devise. 2011-12-05 11:28:04 +01:00
José Valim
035e56215d Enable reconfirmable by default and disable apply_schema. 2011-12-05 00:03:53 +01:00
José Valim
fa4d420fdb Update CHANGELOG. 2011-12-05 00:01:25 +01:00
José Valim
bd27bf7677 Deprecate and disable old behavior accumulated with time. 2011-12-04 23:58:19 +01:00
José Valim
03d9ebb56e Merge branch 'reconfirm' 2011-12-04 22:19:07 +01:00
José Valim
113b48a2ad Update CHANGELOG. 2011-12-04 22:18:58 +01:00
José Valim
6aed8f1c87 Clean up reconfirmable behavior. 2011-12-04 22:14:44 +01:00
José Valim
6d681c5b8a Merge remote-tracking branch 'heimidal/updates' into reconfirm
Conflicts:
	lib/devise/models/confirmable.rb
	test/support/helpers.rb
2011-12-04 20:58:41 +01:00
José Valim
b3034292f2 Ensure admin is running with manual lock strategy. 2011-12-01 13:19:05 +01:00
Rodrigo Flores
4243791b47 Bumping to 1.5.2 2011-11-30 07:19:12 -02:00
Rodrigo Flores
b79c69140d Adding myself to the team! w00t! 2011-11-30 07:19:12 -02:00
José Valim
ede004169c Merge pull request #1462 from lest/timeout-in-method
implement dynamic value for timeout_in as a model method instead of a proc
2011-11-25 00:27:18 -08:00
lest
37dad2172b implement dynamic value for timeout_in as a model method instead of a proc 2011-11-25 11:01:42 +03:00
José Valim
c8c471a128 Merge pull request #1461 from lest/fix-readme-mongodb-version
fix mongodb version required to run tests in readme
2011-11-24 14:48:26 -08:00
lest
f72ff72c0c fix mongodb version required to run tests in readme 2011-11-24 22:10:42 +03:00
Rodrigo Flores
dc3bfac876 Merge pull request #1460 from lest/dynamic-timeout-in
timeout_in option can be a Proc object
2011-11-24 11:10:08 -08:00
lest
426223dda0 timeout_in option can be a Proc object 2011-11-24 21:42:58 +03:00
José Valim
5909d6a0c5 Fix up previous commit and update CHANGELOG. 2011-11-24 09:24:06 +00:00
José Valim
5570929b56 Merge pull request #1458 from kirs/update-attrubutes-as
Added support for rails 3.1 new mass assignment conventions
2011-11-24 00:59:13 -08:00
Kir
5ba6670164 Added support for rails 3.1 new mass assignment conventions 2011-11-24 12:51:03 +04:00
José Valim
589442b09b Update lib/devise/omniauth/config.rb 2011-11-24 08:32:48 +00:00
José Valim
0c67cff2a0 Merge pull request #1455 from AstonJ/readme-installation-update
Adding reminder to restart server in the installation guide
2011-11-23 00:43:48 -08:00
José Valim
9c3d5705b5 Update lib/generators/templates/devise.rb 2011-11-23 08:42:45 +00:00
AstonJ
2f2662e7a5 Adding reminder to restart server in the installation guide 2011-11-23 01:31:20 +00:00
Rodrigo Flores
99040535d7 Bumping to 1.5.1 2011-11-22 13:12:21 -02:00
José Valim
582f00ed95 Devise should not attempt to load OmniAuth strategies. Strategies should be loaded before hand by the developer or explicitly given to Devise. 2011-11-20 19:42:02 +00:00
José Valim
1d2f906af1 Tidy up Gemfile. 2011-11-20 19:22:38 +00:00
José Valim
dfb8ff372d Revert "Fixed require_strategy for google_oauth2 omniauth strategy."
This reverts commit 065963f6d3.
2011-11-20 19:21:08 +00:00
José Valim
1e37e42239 Do not use stored location for sign out. 2011-11-20 19:19:41 +00:00
José Valim
ce1bd142e2 Merge pull request #1438 from hinrik/master
Allow specifying a resource_return_to for sign out
2011-11-20 11:17:44 -08:00
Rafael Mendonça França
35015e5ceb Add me as notification recipient 2011-11-14 16:37:39 -02:00
Rafael Mendonça França
03b56ffd1f Merge pull request #1441 from buggle/master
fixed require for google_oauth2 strategy
2011-11-14 10:24:32 -08:00
Christian Buggle
065963f6d3 Fixed require_strategy for google_oauth2 omniauth strategy. 2011-11-14 19:14:28 +01:00
Rodrigo Flores
a71319a080 Bumping to 1.5.0 2011-11-13 19:17:03 -02:00
Hinrik Örn Sigurðsson
9ea7249368 Allow specifying a resource_return_to for sign out
It was impossible to accomplish this by providing a
custom #after_sign_out_path_for in ApplicationController because the
session gets destroyed before it is called. Furthermore,
resource_return_to is now used by default if it exists, so users won't
have to provide a custom #after_sign_out_path_for in that case.
2011-11-13 20:27:08 +00:00
Rodrigo Flores
301e24c06c Bumping to 1.5.0.rc 2011-11-10 19:18:54 -02:00
Rodrigo Flores
6b108404ba Adding me to ci notifications 2011-11-10 18:40:28 -02:00
Rodrigo Flores
0b661b6d7f Updated changelog 2011-11-10 18:40:28 -02:00
Rodrigo Flores
3ab68a6896 Some changes on config_test to make it looks like the other ones 2011-11-10 18:39:52 -02:00
José Valim
97d8e39932 Update CHANGELOG.rdoc 2011-11-10 16:18:10 -02:00
José Valim
5c71c1cf19 Improve devise generator tests. 2011-11-10 10:19:57 -02:00
José Valim
dc8aa9ef83 Move param filtering to its own object and make all finder methods pass through it, closes #1413. 2011-11-10 10:14:02 -02:00
José Valim
ab54e1f66a Update CHANGELOG: Markerb templates. 2011-11-10 09:32:13 -02:00
José Valim
0fd5493220 Merge pull request #1326 from sbounmy/master
feature added : markerb generator for mails
2011-11-10 03:27:53 -08:00
Rodrigo Flores
5c3f75d90a Merge pull request #1426 from TamiasSibiricus/omniauth-1.0.0
Support OmniAuth 1.0.0 stable
2011-11-10 03:16:53 -08:00
Paul McKellar
e8aabd4652 s/Gererates/Generates/ 2011-11-09 20:58:58 -02:00
José Valim
350bd188df Merge pull request #1435 from nashby/master
use Time.now.utc instead of Time.now, closes #1421
2011-11-09 12:31:53 -08:00
Vasiliy Ermolovich
7e9ba53d82 use Time.now.utc instead of Time.now, closes #1421 2011-11-09 23:26:48 +03:00
José Valim
16208f7ad7 Rework previous commit to clean up the instance variable dynamically. 2011-11-09 17:00:42 -02:00
José Valim
cc822e08aa Merge pull request #1433 from artemk/master
current_user still returning user after sign_out
2011-11-09 10:52:13 -08:00
artemk
c3880e52e4 #1432 current_user still returning user after sign_out 2011-11-09 20:35:19 +02:00
Hugo Baraúna
a5aa03b983 Update the Copyright year 2011-11-08 22:59:04 -02:00
Rodrigo Flores
06b7baabcc Changed travis ci url 2011-11-08 15:42:11 -02:00
Rodrigo Flores
b7cffeed8c Ops, no need for the link to have https 2011-11-08 15:39:05 -02:00
Rodrigo Flores
380df0121b Adding https to avoid caching the travis passing status img 2011-11-08 15:27:26 -02:00
José Valim
611e0335cc Temporarily remove jruby from travis because 1.6.5 has a null pointer exception bug. 2011-11-07 21:39:27 -02:00
José Valim
22136a708b Fix failure_app failing test. 2011-11-07 21:38:31 -02:00
TamiasSibiricus
2a29e87eb9 Update dependencies for OmniAuth 1.0.0 stable 2011-11-07 22:58:33 +02:00
Denis Kiselev
ea9e8c0c9b Merge remote-tracking branch 'dkastner/omniauth-1.0' into omniauth-1.0.0
Conflicts:
	test/omniauth/url_helpers_test.rb
2011-11-07 22:26:51 +02:00
José Valim
58d61c290a Update CHANGELOG. 2011-11-07 09:20:09 -02:00
José Valim
bad6049d73 Allow :failure_app as configuration in devise_for. 2011-11-07 09:20:09 -02:00
José Valim
24b26026ef Delegator now checks the mapping for the proper failure app. 2011-11-07 09:20:09 -02:00
José Valim
4629beecd7 Cache failure_app action builder and pipe call through delegator. 2011-11-07 09:20:09 -02:00
José Valim
f67793cb0d Merge pull request #1423 from plataformatec/adding-ci-status-to-readme
Added CI status to the README
2011-11-06 14:39:51 -08:00
Rodrigo Flores
538c16cd00 Added CI status to the README 2011-11-06 20:18:46 -02:00
José Valim
3a26eea0cc Support warden ~> 1.1, closes #1422 2011-11-06 18:47:55 -02:00
José Valim
f9ef2cd32e Merge pull request #1420 from nashby/master
generate migrations with new .change method for rails >= 3.1. closes #1345
2011-11-06 05:23:58 -08:00
Vasiliy Ermolovich
493ddbd99e change method should be instance method. closes #1345 2011-11-06 16:15:17 +03:00
Vasiliy Ermolovich
f00d9c5eff generate migrations with new .change method for rails >= 3.1. closes #1345 2011-11-06 15:47:34 +03:00
José Valim
95be78ac5e No need to use git repo anymore for jdbc adapter. 2011-11-06 09:42:22 -02:00
José Valim
e9c263c326 Merge pull request #1418 from locomotivecms/simple_scoped_mailer
Re-define the devise mailer inside a model
2011-11-06 01:38:08 -08:00
José Valim
1bace6df4e Be sure to expire cached devise data after sign in, closes #1411 2011-11-05 20:11:09 -02:00
José Valim
0439c35198 Simplify active_for_authentication? checking. 2011-11-05 19:54:40 -02:00
José Valim
a816e538ab Fix bug where activation messages were shown first than the credentials error message, closes #1410 2011-11-05 19:47:58 -02:00
did
bbd117bd92 implementation of a much simpler solution 2011-11-05 16:53:27 +01:00
José Valim
d448e7d841 Timeoutable also skips tracking if skip_trackable is given 2011-10-25 18:43:48 +02:00
José Valim
6fcfba229d Improve docs for update_without_password. 2011-10-25 18:43:48 +02:00
José Valim
d525636423 Merge pull request #1398 from salidux/master
Trackable don't work properly behind a proxy
2011-10-22 10:51:19 -07:00
salidux
d11402612f test for trackable behind a proxy 2011-10-22 11:57:18 -02:00
José Valim
6079a025ca Fix doc typo. 2011-10-21 13:38:39 +03:00
José Valim
81f0c203a9 Update CHANGELOG. 2011-10-20 16:50:38 +02:00
salidux
60822641cb fix to obtain user original IP in a proxyed environment 2011-10-19 22:23:04 -02:00
José Valim
fac02b58bc Another attempt to fix the misterious loading helpers bug. 2011-10-18 08:35:50 +02:00
Derek Kastner
c9902f34d1 Intelligent OmniAuth strategy loader 2011-10-17 13:42:40 -04:00
Derek Kastner
8b45c0a856 Correct test for named OmniAuth strategy 2011-10-17 10:09:47 -04:00
José Valim
2a5ad4664b Change all paranoid settings to behave as success instead of as failure, closes #1375. 2011-10-15 10:52:00 +02:00
Jim Herzberg
b98720d324 jh - reworking paranoid mode in passwords controller
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-15 10:45:33 +02:00
Derek Kastner
3f0b5fbd71 Support for OmniAuth 1.0.0 2011-10-14 21:31:17 -04:00
José Valim
fa1034b04c Merge pull request #1384 from korobkov/master
many typos (http -> https)
2011-10-13 15:21:21 -07:00
Andrey Korobkov
13ed2183ee many typos (http -> https) 2011-10-13 19:14:10 +04:00
Rafael Mendonça França
6fae1f60fd Merge pull request #1383 from korobkov/patch-1
typo
2011-10-13 07:15:07 -07:00
Andrey Korobkov
a46144e022 typo 2011-10-13 18:14:09 +04:00
Brian Rose
7f754caba3 Merge branch 'master' into updates 2011-10-12 10:56:08 -06:00
José Valim
2372823fd8 Merge pull request #1372 from avocade/readme-update
Update README with troubleshooting for heroku
2011-10-10 10:37:26 -07:00
Oskar L-B
52282a5a26 Update README with troubleshooting for heroku
Re: issue https://github.com/plataformatec/devise/
commit/96f55a7ac7a61effd03a7f43dbbdfb6af8894579
2011-10-10 19:33:46 +02:00
José Valim
96f55a7ac7 Update docs and CHANGELOG.
Conflicts:

	CHANGELOG.rdoc
2011-10-10 14:45:30 +02:00
José Valim
990dcc8eef Try to fix the misterious case where some url helpers are not defined. 2011-10-09 11:50:48 +02:00
Bounmy Stephane
76bff0d4de removed Gemfile's injection
by default : Markerb define then markerb email views generated otherwise
erb
2011-09-30 22:41:02 -07:00
José Valim
59f2767345 Remove deprecated code and tests. 2011-09-29 13:11:12 +02:00
José Valim
bba6562dcc after_sign_in_path_for now redirects to session[scope_return_to] if any value is stored in it 2011-09-29 13:07:13 +02:00
José Valim
f3aa5e40fb Update CHANGELOG and bump up to 1.5.0.dev 2011-09-29 12:52:56 +02:00
José Valim
1e2dab3c0c Assume status 401 if action finishes without status code and no exception, closes #1316. 2011-09-29 12:28:32 +02:00
José Valim
bc8fc2d4e4 Allow idempotent API requests, closes #1309. 2011-09-29 11:35:18 +02:00
José Valim
15b76e93d1 The default here is now DELETE. 2011-09-27 10:42:08 +03:00
José Valim
bc2a311a38 Rails is going to load the routes anyway, so we don't need this. 2011-09-24 03:13:39 +03:00
José Valim
f19955705f Avoid loading routes if we are actually precompiling assets. 2011-09-22 21:56:18 +03:00
José Valim
e4902af15a Release 1.4.7 with a backward compatibility fix. 2011-09-22 11:51:58 +02:00
José Valim
ab9d856568 Add a deprecation warning for previous controller authorization style. 2011-09-22 11:51:09 +02:00
José Valim
dd1d128333 Edited lib/generators/templates/devise.rb via GitHub 2011-09-21 12:58:10 -07:00
Bounmy Stephane
a629654a15 ensure that the gem markerb entry is not duplicated in the gemfile 2011-09-14 20:20:20 -07:00
José Valim
08a8d7bf51 Prepare for 1.4.6 2011-09-14 16:54:15 -07:00
José Valim
335d36088f Instead of depending on mapping.controller[:session], make it explicit when we allow auth from params. 2011-09-14 16:52:28 -07:00
José Valim
0b9a95e294 Allow --skip-routes to devise generator. 2011-09-14 16:52:28 -07:00
José Valim
98acc84111 Allow options to be passed to authenticate_user! 2011-09-14 16:52:28 -07:00
José Valim
261c01dfa3 Allow :skip => :all 2011-09-14 16:52:28 -07:00
Bounmy Stephane
dbda19f658 implemented markerb templates 2011-09-13 22:56:50 -07:00
Bounmy Stephane
8067022d98 added injection of markerb in Gemfile 2011-09-13 22:50:39 -07:00
Bounmy Stephane
72ba56b071 generate markerb views with "--markerb" instead of "-m markerb" 2011-09-13 21:46:46 -07:00
Bounmy Stephane
30046f35d7 moved markerb views to lib/generator/templates/markerb
using 2 different generator for erb and markerb
2011-09-13 21:42:10 -07:00
Bounmy Stephane
10451e9e38 added mailviewsgenerator
now mail generator can copy markerb or erb mail template views
2011-09-13 00:19:48 -07:00
José Valim
ea7f15917f Merge pull request #1322 from trollixx/patch-1
Typo
2011-09-09 03:01:54 -07:00
Oleg Shparber
df3e711ee0 Typo 2011-09-09 12:46:35 +03:00
José Valim
263e903046 Release v1.4.5 2011-09-08 23:55:27 +02:00
George Guimarães
f7bbac0ab9 sets travis to report to maintainers 2011-09-08 08:31:34 -03:00
José Valim
9ebcb691b0 Depend on jdbc master. 2011-09-08 09:05:06 +02:00
José Valim
601e1d3dc9 Update CHANGELOG. 2011-09-08 08:36:06 +02:00
José Valim
7b0a8f9bdc Also try the root route for convenience, closes #1312. 2011-09-08 08:32:05 +02:00
José Valim
dd36324756 No need to finalize Devise helpers all the time, closes #1317 2011-09-08 08:31:08 +02:00
José Valim
1b5d0af824 Merge pull request #1313 from jamescook/fix_bug_with_update_with_password
DatabaseAuthenticatable#clean_up_passwords should set accessors to nil
2011-09-02 10:48:47 -07:00
James Cook
edcca8cd3f DatabaseAuthenticatable#clean_up_passwords should set accessors to nil, not empty string. 2011-09-02 13:14:15 -04:00
José Valim
c95ca15b49 Edited lib/devise.rb via GitHub 2011-09-02 13:35:31 +03:00
José Valim
055117e07a Merge pull request #1308 from rymai/conditional_sign_in_after_password_reset
Implement #1306.
2011-09-01 00:19:56 -07:00
Rémy Coutable
ebbabaea5b After a password reset, don't show "You are now signed in." if the user can't be signed-in anyway. 2011-09-01 00:24:10 +02:00
José Valim
eba53f8f94 Test against 3.1.0. 2011-08-31 17:16:56 +02:00
José Valim
071f54ac59 Release v1.4.4 with a fix for those using :skip in routes. 2011-08-31 16:45:12 +02:00
José Valim
8796c1c601 Do not always skip helpers, instead provide :skip_helpers as option to trigger it manually 2011-08-31 12:02:57 +02:00
Brian Rose
8c0f74f036 Add better message when user updates while reconfirmable is enabled. 2011-08-30 22:19:18 -06:00
Brian Rose
5a820262f9 Fix double-submit reconfirmation bug
Previously, if a user submitted their new email twice, they would bypass
the reconfirmation requirement and wind up auto-confirmed.
2011-08-30 22:19:18 -06:00
Brian Rose
3906456993 Clean up copy and use the Devise API a bit better. 2011-08-30 22:19:18 -06:00
Brian Rose
a1407565c8 Selectively add reconfirmable field in tests when necessary. 2011-08-30 22:19:18 -06:00
Brian Rose
a7c5a2e65d Fix up implementation of reconfirmable. 2011-08-30 22:19:17 -06:00
mandaryn
10ac4dbc35 reconfirmable uniqueness validations 2011-08-30 22:19:17 -06:00
mandaryn
6469cbc62a renamed confirmation_on_email_change property to reconfirmable and added reconfirmable explanations 2011-08-30 22:19:17 -06:00
mandaryn
1961de6b5d Add email confirmation when it is changed by a user 2011-08-30 22:19:17 -06:00
José Valim
ef4eb47d50 Release v1.4.3 with improve Rails 3.1 compatibility. 2011-08-30 14:35:19 +02:00
José Valim
295088f9e8 Depend on latest Rails. 2011-08-30 14:33:23 +02:00
José Valim
4222afe3c7 Tidy up latest commits, update CHANGELOG. 2011-08-30 10:50:40 +02:00
José Valim
79d89a3c20 Merge pull request #1297 from seanski/master
Patch for Issue 1259 -- New
2011-08-30 01:44:30 -07:00
Sean Hill
8ad414b217 Added a helper to look for an modifying migration. If one is found during :revoke, the modifying migration is deleted. If the modifying migration is not found, the creating migration is deleted. 2011-08-29 17:53:32 -05:00
José Valim
7b1418be3b Improve the regexp a bit more. 2011-08-29 14:55:56 +02:00
José Valim
7396c6911d Quack, quack, quack. Use duck typing instead of hardcoding everything, closes #1281. 2011-08-29 14:40:49 +02:00
José Valim
673c707085 Update CHANGELOG. 2011-08-29 14:31:09 +02:00
José Valim
f21d05a235 Only generate helpers for the used mappings, closes #1288 2011-08-29 14:29:38 +02:00
José Valim
1dd19c1a72 Wrap :actions constraints in the proper hash, closes #1280 2011-08-29 13:29:30 +02:00
José Valim
a8d9695324 Simplify regexp and ensure it runs against UTF8 chars, closes #1235 2011-08-29 13:15:40 +02:00
Sean Hill
99d539b9a7 Chagned the copy_devise_migration method to properly handle the :revoke behavior using @daf's commit: acf7e9e2ad as a guide. 2011-08-28 16:29:06 -05:00
Sean Hill
179cb2c88a Changed the order of the devise_generator methods to create the model after the migration to properly use model_exists?, and I added tests to prove the generator works. 2011-08-28 16:02:58 -05:00
Sean Hill
9629da863d Added a template to create a migration when the model already exists. Changed the generator code to check if model exists, and if it does, call the new template instead of the standard template. 2011-08-25 07:05:19 -05:00
José Valim
4f76e6f577 Depend on latest bcrypt. 2011-08-25 13:22:48 +02:00
José Valim
0f3cef4091 Merge pull request #1282 from apocalyptiq/master
Allow to set default 'from' header of Devise mails in custom mailer class
2011-08-20 13:48:45 -07:00
Szymon Przybył
7665cbf21d Allow to set default 'from' header of Devise mails in custom mailer class 2011-08-20 22:35:47 +02:00
José Valim
b9413ab316 Merge pull request #1275 from bquorning/it's_not_"it's",_it's_"its"
Fix usage of “its” / “it’s” in documentation
2011-08-16 15:20:01 -07:00
Benjamin Quorning
a3bff7d6a2 Fix usage of "its" / "it's" in documentation 2011-08-16 22:15:25 +02:00
José Valim
7e54dc7903 Edited lib/devise/models/lockable.rb via GitHub 2011-08-16 08:00:44 -07:00
José Valim
fb1220af97 Merge pull request #1264 from invisiblefunnel/master
Fixes small typo in routes documentation
2011-08-11 20:40:25 -07:00
Daniel Whalen
282c7e85ec Fix documentation typo 2011-08-11 20:16:20 -07:00
José Valim
bc15bb53dc Merge pull request #1261 from rumblestrut/patch-1
Changed "It's composed of 12 modules:" to "It's comprised of 12 modules .
2011-08-10 22:20:08 -07:00
Eric J. Gruber
a729e059de Changed "It's composed of 12 modules:" to "It's comprised of 12 modules ..." Comprised is the better word choice in this instance, meaning "Consist of; be made up of." 2011-08-10 21:46:52 -05:00
José Valim
7c628f7689 Merge pull request #1237 from novalis/master
friendly_token should be friendlier
2011-08-10 17:25:06 -07:00
David Turner
6d65c28f1f remove hard-to-distinguish characters from friendly_token 2011-08-10 12:44:30 -04:00
José Valim
31e4ef5e4b Merge pull request #1258 from wildchild/master
Don't require explicit scope in authenticate router extension
2011-08-10 05:23:29 -07:00
Alexander Uvarov
d38341b5e0 Don't require explicit scope in authenticate router extension 2011-08-10 15:41:06 +06:00
Rafael Mendonça França
ff90d9da9c Merge pull request #1251 from michaelklishin/patch-1
Re-add JRuby to the build matrix
2011-08-08 08:01:41 -07:00
Michael Klishin
84c62ed034 Re-add JRuby to the build matrix
We hopefully resolved our JRuby woes on travis-ci.org.
2011-08-07 20:55:59 +04:00
José Valim
e76ba05516 Merge pull request #1249 from ches/mongoid-fixes
Tests that should no longer exclude Mongoid
2011-08-06 08:21:48 -07:00
José Valim
90d99b16f1 Merge pull request #1250 from ches/unenforced-auth-keys
Fix optional enforcement of particular authentication keys
2011-08-06 08:20:30 -07:00
Ches Martin
3cedba1de8 Fix optional enforcement of particular authentication keys
Documentation states that authentication_keys should accept a hash with
values indicating whether or not each key is required. This was added in
b2066cc2 but tests only covered request_keys, and 29afe2d2 later broke
it with a << array operator.
2011-08-06 20:07:49 +07:00
Ches Martin
ccbf26be0a Tests that should no longer exclude Mongoid 2011-08-06 19:28:19 +07:00
José Valim
6448490de5 Edited lib/generators/templates/devise.rb via GitHub 2011-08-05 20:45:39 +03:00
José Valim
98651dae9d Merge pull request #1241 from dbloete/patch-1
Speed up tests by defaulting to 1 stretch in test env
2011-08-05 10:43:54 -07:00
José Valim
bf57ef400d Merge pull request #1247 from michaelklishin/patch-1
It is #rbxday, lets test against Rubinius 2.0 preview, too
2011-08-05 09:36:31 -07:00
Michael Klishin
27cae04446 It is #rbxday, lets test against Rubinius 2.0 preview, too 2011-08-05 20:34:33 +04:00
José Valim
430eadc1b2 Merge pull request #1245 from michaelklishin/patch-1
Disable testing against JRuby, it has known issues on travis-ci.org.
2011-08-05 09:31:36 -07:00
Michael Klishin
e954737a92 Disable testing against JRuby, it has known issues on travis-ci.org.
We will figure out JRuby issues with the JRuby core team and let you know
2011-08-05 16:26:11 +04:00
José Valim
191d5222e7 Merge pull request #1244 from ches/docs
Doc tweaks
2011-08-05 05:22:24 -07:00
Ches Martin
e77af4b40f Doc: DB authenticatable schema no longer includes salt 2011-08-05 20:13:01 +08:00
Ches Martin
da3c47259d Doc: DB authenticatable schema no longer includes salt 2011-08-05 17:33:50 +07:00
Ches Martin
c95575b284 Doc: DatabaseAuthenticatable still uses pepper option 2011-08-05 17:08:26 +07:00
José Valim
7a5086a2be Merge pull request #1242 from ches/mongoid-fixes
Fix failing Mongoid tests
2011-08-04 13:38:57 -07:00
Ches Martin
c3a665320e Merge branch 'master' into mongoid-fixes
* master:
  Untrack Gemfile.lock

Conflicts:
	Gemfile.lock
2011-08-05 03:19:05 +07:00
Dennis Reimann
372dfecf05 Added a comment about the stretch change 2011-08-04 23:00:12 +03:00
Dennis Reimann
68bd6809a7 Speed up tests by defaulting to 1 stretch in test env 2011-08-04 22:50:06 +03:00
Ches Martin
7bfdd07a71 Initializer caveats warning for Mongoid < 2.1 2011-08-05 02:41:31 +07:00
Ches Martin
6bc93173f1 Restore forlorn Mongoid generator tests 2011-08-05 02:40:42 +07:00
Ches Martin
55af9f8a40 Fix failing Mongoid tests
- attr_accessible not set for test user model, making Serializable tests
  inaccurate
- Mongoid does not `include_root_in_json` by default, so enable this for
  consistency with AR tests
- Mark tests pending for Mongoid < 2.1 that fail there due to known bugs
- Add `:mongoid` key for i18n model labels
- Remove outdated shim of `update_attribute` that caused mass assignment
  security to be applied (ugh, that took awhile to find)
2011-08-05 01:38:42 +07:00
José Valim
866b35d27c Merge pull request #1239 from ches/gemfile-lock
Untrack Gemfile.lock
2011-08-04 04:16:50 -07:00
Ches Martin
5374119f18 Untrack Gemfile.lock
Gemfile.lock is for app deployment, not public library development:

http://yehudakatz.com/2010/12/16/clarifying-the-roles-of-the-gemspec-and-gemfile/
2011-08-04 11:33:53 +07:00
José Valim
919404df53 Merge pull request #1228 from dasil003/master
Set up Recoverable to automatically confirm! if Comfirmable
2011-08-02 12:41:09 -07:00
Gabe da Silveira
fd07c74578 Refactor to use method and override 2011-08-02 12:08:38 -07:00
José Valim
560961e3fc Merge pull request #1233 from asanghi/master
sign_in should return true and assert that. fixes #1232
2011-08-02 03:04:51 -07:00
Aditya Sanghi
873e49ab66 sign_in should return true in case user is already signed in and assert that. 2011-08-02 14:35:46 +05:30
José Valim
0f8f786f9f Use a default key on inactive reason. 2011-08-02 11:18:23 +03:00
José Valim
7b3e267729 Merge pull request #1231 from hck/master
added I18n support to inactive_message in RegistrationsController
2011-08-02 01:14:16 -07:00
hck
7264bb55b2 added I18n support to inactive_message in RegistrationsController 2011-08-02 08:11:25 +03:00
Gabe da Silveira
ed6dfed67f Resetting password should confirm implicitly 2011-07-29 14:26:19 -07:00
Gabe da Silveira
3488066031 Spelling correction 2011-07-29 14:17:31 -07:00
José Valim
bc9ea93f50 Merge pull request #1224 from gtalton/patch-2
Edited lib/devise/rails/routes.rb via GitHub
2011-07-29 03:18:40 -07:00
Gerald Talton
1920b79a0d Edited lib/devise/rails/routes.rb via GitHub 2011-07-28 15:23:23 -05:00
José Valim
9131570703 Merge pull request #1221 from hazah/master
Change :except to :only for registration routes
2011-07-26 10:45:36 -07:00
=
770c1a973f Changed :except to :only for devise_registration method of the routing mapper. 2011-07-26 13:42:00 -04:00
José Valim
b7b21a0b72 Merge pull request #1211 from mathieuravaux/master
Issue #1206 fix ((TokenAuthenticatable#params_auth_hash behavior)
2011-07-25 05:11:26 -07:00
Mathieu Ravaux
4d91fb4910 Untangled the logic in Devise::Strategies::TokenAuthenticatable#params_auth_hash 2011-07-25 09:10:25 +02:00
Rafael Mendonça França
4ce9d6f29a Merge pull request #1212 from mattupstate/patch-1
Typo in doc comment
2011-07-23 15:06:02 -07:00
Matt Wright
d2a4c503f7 Typo in doc comment 2011-07-23 15:03:10 -07:00
Mathieu Ravaux
a2700bc17f Fixed issue #1206: TokenAuthenticatable#params_auth_hash behaving in an unexpected way for the authentication token lookup 2011-07-23 17:45:45 +02:00
José Valim
0a04d73883 Merge pull request #1198 from andriytyurnikov/issue_1197
div instead of p in forms
2011-07-14 05:47:46 -07:00
Andriy Tyurnikov
502dae3c1f div instead of p in forms 2011-07-14 15:43:10 +03:00
José Valim
e9c766277d Merge pull request #1194 from waynn/patch-1
quick typo fix
2011-07-11 11:37:18 -07:00
Waynn Lue
762f3907fa quick typo fix 2011-07-11 11:30:52 -07:00
José Valim
3698b64a10 Merge pull request #1190 from joliss/whitespace
Remove whitespace from generator template
2011-07-08 11:25:35 -07:00
Jo Liss
2a6c160d39 Remove whitespace from generator template 2011-07-08 18:41:16 +02:00
José Valim
795754cd60 Merge pull request #1189 from netmute/master
Add ability to override redirect_to path after account confirmation.
2011-07-08 03:27:21 -07:00
Simon Ernst
517343ddb5 Add ability to override redirect_to path after account confirmation. 2011-07-08 11:21:01 +02:00
Rodrigo Flores
90a5e2f9af Added rdoc on the Gemfile 2011-07-02 01:33:34 -03:00
Rodrigo Flores
93180fbb6d Removed a rdoc deprecation warning 2011-07-01 20:37:21 -03:00
José Valim
04cb78947a Edited CHANGELOG.rdoc via GitHub 2011-07-01 04:23:31 -07:00
José Valim
5423f2d5cb Properly deprecate setup_mail 2011-07-01 04:23:12 -07:00
José Valim
51d15b7293 Add more missing :require => true 2011-06-30 15:29:35 -03:00
José Valim
7a2e018df8 Release 1.4.2. 2011-06-30 15:20:13 -03:00
José Valim
1fd4beb18a Move simple_form_for directories to a new location. 2011-06-30 15:09:54 -03:00
José Valim
33d7644b4f Provide a more robust behavior to serializers and add :force_except option 2011-06-30 10:43:33 -03:00
José Valim
5a98e4f4e8 Temporary fix for 3-1-stable that does not implement key? on cookie jar, closes #1179 2011-06-30 08:04:32 -03:00
José Valim
82ae53dd75 Released v1.4.1. 2011-06-29 20:26:35 -03:00
José Valim
07db04e773 Work around AR that does not call serializable_hash on to_xml. 2011-06-29 20:18:10 -03:00
José Valim
6a8ee475fd This was fixed in mongoid, closes #770. 2011-06-29 20:18:10 -03:00
José Valim
767a7a7c21 Ensure handle_unverified_request clean up any cached signed-in user 2011-06-29 20:18:10 -03:00
José Valim
a3b56f7eb1 Merge pull request #1175 from jhllnd/patch-1
Added :registerable to the examples
2011-06-28 04:58:51 -07:00
jhllnd
5e1a998cde Added :registerable to the examples 2011-06-28 03:19:00 -07:00
José Valim
219fbc0056 Fix tests, remove whitespace and update CHANGELOG. 2011-06-28 07:05:35 -03:00
José Valim
dcee6413f4 Merge pull request #1173 from zedtux/master
Internationalization of resource_name in DeviseHelper#devise_error_messages!
2011-06-28 02:58:15 -07:00
Guillaume Hain
e2895239d8 Internationalization of resource_name in DeviseHelper#devise_error_messages! 2011-06-27 20:31:03 +02:00
José Valim
c8077c8d9f Add more docs to routes. 2011-06-27 13:04:40 -03:00
José Valim
46c2d5a8f2 Update CHANGELOG. 2011-06-27 12:16:06 -03:00
José Valim
adb127bb3e Default to delete on new templates. 2011-06-27 12:15:23 -03:00
José Valim
42f0285278 Extract mailer functionality, closes #1164 2011-06-27 12:13:00 -03:00
José Valim
13ef23f517 Add simple form generators. 2011-06-27 11:50:28 -03:00
José Valim
0bf28b19ab Simple use hook_for. 2011-06-27 11:31:29 -03:00
José Valim
29a0af78bc Refactor view generators. 2011-06-27 11:22:44 -03:00
José Valim
cf487c771e Merge pull request #1172 from bjnord/format-false
More transparent implementation of :format => false
2011-06-27 05:15:05 -07:00
Brent J. Nordquist
7e711089a8 More transparent implementat'n of :format => false
Per josevalim, by setting {:format => false} in @scope[:options],
Rails will pick it up, without the need to alter each devise_*()
method individually.
2011-06-27 06:51:04 -05:00
Brent J. Nordquist
1c81a40a76 Support options[:defaults] and @scope[:defaults]
similar to support for :constraints
2011-06-26 19:48:20 -05:00
Samuel Cochran
2b64c6d951 Make all controllers inherit from a single DeviseController 2011-06-25 03:34:13 +08:00
Rodrigo Flores
dba8f91f99 \o/ Bumping to 1.4.0 \o/ 2011-06-23 09:53:05 -03:00
José Valim
8e70e71143 Update CHANGELOG. 2011-06-23 09:42:32 -03:00
José Valim
f43a7c4f24 Merge pull request #1147 from sj26/master
Authenticated Route Constraints
2011-06-23 05:29:17 -07:00
José Valim
4e56d92ed8 Override serializable_hash instead of to_xml and to_json. 2011-06-23 09:25:50 -03:00
José Valim
5645d733ba Update CHANGELOG. 2011-06-23 09:22:30 -03:00
José Valim
42b07f1f47 Merge remote branch 'origin/issue_json_response'
Conflicts:
	app/controllers/devise/passwords_controller.rb
2011-06-23 09:16:04 -03:00
Samuel Cochran
e75354b3b0 Tests. 2011-06-23 10:44:46 +08:00
Samuel Cochran
80122856c4 Switch to Warden::Proxy#authenticate?
Warden::Proxy#authenticated? and Warden::Proxy#unauthenticated? don't try strategies first.
2011-06-23 10:44:23 +08:00
Rodrigo Flores
308238ab42 Not responding the object on creating unlockable requests 2011-06-22 23:04:55 -03:00
Rodrigo Flores
e937cf78cf Added a test for empty json on unlockable controller response 2011-06-22 23:00:15 -03:00
Rodrigo Flores
2ae2fdc9f8 Returning an empty JSON for creating confirmation requests 2011-06-22 21:27:20 -03:00
Rodrigo Flores
3184834d72 Added tests for confirmable 2011-06-22 21:26:32 -03:00
Rodrigo Flores
8ef5534d92 Moved the test to after the XML tests 2011-06-22 21:04:50 -03:00
Rodrigo Flores
41bb96be5d Returning empty json and empty xml 2011-06-22 19:38:21 -03:00
Rodrigo Flores
b37055fa47 Added a test to return empty json 2011-06-22 19:38:21 -03:00
José Valim
515b727f52 Change default rake. 2011-06-22 15:39:50 -03:00
José Valim
77d6d1e8c2 Do not try to authenticate with no_input_strategies are empty. 2011-06-22 15:28:49 -03:00
José Valim
04b614ce10 Edited app/controllers/devise/passwords_controller.rb via GitHub 2011-06-22 11:03:08 -07:00
José Valim
62e11ddbe4 Update CHANGELOG. 2011-06-22 13:07:19 -03:00
Rodrigo Flores
8e3ab5921f Merge branch 'paranoid-mode' 2011-06-22 12:57:37 -03:00
Rodrigo Flores
1d87997647 Improved paranoid mode generator explanation 2011-06-22 12:52:11 -03:00
Rodrigo Flores
b58e0ef991 Removed useless blank lines 2011-06-22 12:52:11 -03:00
Rodrigo Flores
db959da247 Added a commented line for paranoid mode on generator 2011-06-22 12:52:11 -03:00
Rodrigo Flores
6199252011 Refactored paranoid mode actions for it to appear once 2011-06-22 12:52:11 -03:00
Rodrigo Flores
40c0a7b50b Added paranoid mode to lockable 2011-06-22 12:52:11 -03:00
Rodrigo Flores
422bc4aaa6 Added tests for lockable 2011-06-22 12:52:11 -03:00
Rodrigo Flores
225c89fbf1 Paranoid mode on confirmable 2011-06-22 12:52:10 -03:00
Rodrigo Flores
76281ff15c Added tests for paranoid mode on confirmable 2011-06-22 12:52:10 -03:00
Rodrigo Flores
8b54ff699f Refactoring passwords controller 2011-06-22 12:52:10 -03:00
Rodrigo Flores
7d160650b8 Using the same url in success and failure 2011-06-22 12:52:10 -03:00
Rodrigo Flores
803e46cda7 Refactoring the paranoid controller 2011-06-22 12:52:10 -03:00
Rodrigo Flores
004fe2ad12 Paranoid mode for recoverable 2011-06-22 12:50:34 -03:00
Rodrigo Flores
09baf2091e Refactored the tests to use swap 2011-06-22 12:50:34 -03:00
Rodrigo Flores
135a94b4f7 Added a test for the paranoid mode on recoverable 2011-06-22 12:50:34 -03:00
José Valim
a41d185768 Merge pull request #1158 from crx/validate_after_failing_pw_change
Run validations even when password change will fail
2011-06-22 02:28:06 -07:00
Chase DuBois
c3432e57b1 Test for previous commit 2011-06-21 20:45:07 -04:00
Chase DuBois
a8d88d193e Run validations even when password change will fail, to show a complete list of errors 2011-06-21 17:55:32 -04:00
Samuel Cochran
471e4d6e72 Oh hey, Warden has API for this. Should probably match the name, too. 2011-06-21 08:36:06 +08:00
Samuel Cochran
14fec4cfb3 Add #authenticated and #not_authenticated route constraints 2011-06-18 15:53:46 +08:00
José Valim
4bcd1c6fcd Add script so we can skip mongoid tests. 2011-06-17 11:04:15 -03:00
José Valim
84e1a89c44 Fix failing tests. 2011-06-17 10:46:39 -03:00
José Valim
e0162df465 Merge pull request #1145 from macmartine/master
Added support for Devise routes to honor constraints.
2011-06-17 06:27:05 -07:00
Mac Martine
7631456047 Added support for Devise routes to honor constraints. 2011-06-16 21:24:20 -07:00
José Valim
2bc51ab2bd Merge pull request #1143 from joshk/patch-1
the script section in the travis yml isn't needed
2011-06-16 08:21:45 -07:00
Josh Kalderimis
d23ecef831 the script section in the travis yml isn't needed as this is the default behavior 2011-06-16 07:44:50 -07:00
José Valim
c0017ce76d Merge pull request #1138 from fschwahn/update_without_password
added update_without_password method, closes #801
2011-06-15 10:45:18 -07:00
José Valim
30f9da9d71 Update CHANGELOG. 2011-06-10 11:14:08 +02:00
José Valim
e242ca0937 Fix failing tests. 2011-06-10 11:10:56 +02:00
José Valim
17596b0dc6 Merge pull request #1126 from swrobel/master
Add option to strip extra whitespace from emails or other fields
2011-06-10 01:45:43 -07:00
Stefan Wrobel
8e87a2d80d Add strip_whitespace_keys which works like case_insensitive_keys but strips whitespace from emails 2011-06-10 01:37:43 -07:00
José Valim
4964f53a42 Merge pull request #1092 from xavier/filterwhitelist
Conditional string conversion of auth params (Closes #1079)
2011-06-08 08:39:53 -07:00
José Valim
6250fa8529 Revert "Merge pull request #1103 from Mab879/master"
This reverts commit 944e1c0378, reversing
changes made to 97659a1193.
2011-06-08 17:37:49 +02:00
José Valim
944e1c0378 Merge pull request #1103 from Mab879/master
Controller Generator
2011-06-08 08:34:07 -07:00
Matthew Burket
4f446241a4 Added Controller Generator and tests to go along with it. 2011-05-30 23:07:20 -05:00
José Valim
97659a1193 Merge pull request #1099 from paulbellamy/master
Changing references to SecureRandom in generators and encryptable_test
2011-05-28 07:52:09 -07:00
Paul Bellamy
0bcf71f8df Rails has removed SecureRandom from ActiveSupport in Rails 3.2,
deprecated

* Changing references in generators and encryptable_test
2011-05-28 14:44:54 +01:00
Xavier Defrang
ab3bb9cf4d Conditional string conversion of auth params (Closes #1079) 2011-05-26 15:45:03 +02:00
José Valim
69126a31db Merge pull request #1052 from Thibaut/email-validation
Don't validate email format and uniqueness unless it's changed
2011-05-26 05:24:45 -07:00
José Valim
03e3803cff Merge pull request #1089 from skojin/master
support for named/dedicated openid
2011-05-24 13:33:32 -07:00
Sergey Kojin
58f8c7c613 support for named omniauth open_id strategies 2011-05-25 00:15:24 +04:00
José Valim
acd1c76c3b Merge pull request #1087 from eMxyzptlk/patch-2
Rails has removed SecureRandom from ActiveSupport in Rails 3.2, deprecated
2011-05-23 23:49:59 -07:00
Wael Nasreddine
4c8cc5e3f3 SecureRandom is available since Ruby 1.8.7, remove the unnecessary defined? check. 2011-05-24 08:29:15 +02:00
Wael Nasreddine
72bb33f962 Rails has remove SecureRandom from ActiveSupport in Rails 3.2, deprecated in 3.1
Since it has been deprecated, this patch favors SecureRandom on ActiveSupport::SecureRandom
2011-05-23 15:34:09 -07:00
José Valim
2e61e52520 Fix failing test. 2011-05-23 18:22:32 +02:00
José Valim
75490d0375 Merge pull request #1085 from pechkin/master
Devise.mailer
2011-05-23 08:05:38 -07:00
Artem Pechenyi
0fbe4cb6b9 fix reference storage to support new and old class cache api 2011-05-23 17:29:10 +03:00
José Valim
d2b3f49384 Merge pull request #1067 from naomik/master
added ability to override redirect_to path after sending reset password instructions
2011-05-20 11:12:35 -07:00
José Valim
136992b8df Merge pull request #1070 from joshk/filter_auth_params_fix
dup the conditions hash before calling filter_auth_params, this fixes an
2011-05-20 11:07:34 -07:00
José Valim
a130f848f2 Let's run on rubinius again. 2011-05-18 14:13:33 -04:00
Josh Kalderimis
e10bc9e3c0 dup the conditions hash before calling filter_auth_params, this fixes an issue with reseting your password when using a custom auth field like login 2011-05-16 14:08:22 -04:00
naomi
d56741ca4f added ability to override redirect_to path after sending reset password instructions 2011-05-13 11:39:11 -05:00
Thibaut
92c9ed2d6c Don't validate email format and uniqueness unless it's changed. 2011-05-07 19:02:44 +02:00
José Valim
50a5ad54ce Merge pull request #1051 from rymai/patch-1
Remove :anybody_signed_in? from the controller helpers
2011-05-06 02:59:59 -07:00
Rémy Coutable
9dcb44ba61 :anybody_signed_in? helper was deprecated in 73669e09c8 and removed in fe5ef25614 but not removed from the #helper_method call. 2011-05-06 02:46:23 -07:00
fabian
8bdc4b544f added update_without_password method 2011-05-05 09:24:21 +02:00
José Valim
e763f843c4 Tests pass on 3.0.7 2011-05-04 19:24:11 +02:00
José Valim
b5732e31c6 Bump to 3.0.7. 2011-05-04 19:24:11 +02:00
José Valim
ea24ffdd51 Merge pull request #1046 from fschwahn/do-not-follow.
respect do not track headers in trackable
2011-05-04 06:29:52 -07:00
fabian
56f7fbf2d1 use 'devise.skip_trackable' instead of DNT headers 2011-05-04 15:21:12 +02:00
fabian
89b53ea39c respect do not track headers in trackable 2011-05-04 14:44:37 +02:00
Hugo Baraúna
9cc69277bc Fixes a little typo. 2011-04-29 11:26:12 -07:00
José Valim
7e79ed6d4e Update CHANGELOG. 2011-04-29 14:17:33 +02:00
José Valim
b5190d8df2 Refactor. 2011-04-29 14:11:47 +02:00
José Valim
b03c93c4fe Merged pull request #1041 from ecarnevale/master.
fix for issues #999: HTTP_ACCEPT=*/* should redirect to the default location
2011-04-29 05:03:50 -07:00
Emanuel Carnevale
8e12ddf7ed fix for issues #999: HTTP_ACCEPT=*/* should redirect to the default location 2011-04-29 13:22:52 +02:00
José Valim
4fd866d113 User cannot access sign up and similar pages if he is already signed in through a cookie or token, closes #1036. 2011-04-29 08:56:57 +02:00
José Valim
a59410a254 password_required? should not affect length validation, closes #1037. 2011-04-29 08:33:33 +02:00
José Valim
b1a27ad633 Allow controllers to be given as symbols. 2011-04-25 10:00:28 +02:00
Chase DuBois
4a3ad7f348 Use updated Mongoid gem and remove #destroyed? 2011-04-25 15:50:00 +08:00
Chase DuBois
89e4ab8a45 Moved check against record deletion into forget_me! method in model; added unit test. 2011-04-25 15:49:59 +08:00
Chase DuBois
fd8e34650e Make copy of resource only for update action 2011-04-25 15:49:59 +08:00
Chase DuBois
e26c8ce499 Use #persisted? instead of #frozen? to check whether #forget_me should attempt to clear remember token from database 2011-04-25 15:49:59 +08:00
José Valim
64cf8a4534 Update CHANGELOG. 2011-04-21 19:20:48 +02:00
José Valim
ae976f60ca Mark the token as expired, because invalid gives no clue of what to do next. 2011-04-21 19:17:33 +02:00
José Valim
f152860bc5 Update CHANGELOG. 2011-04-21 14:00:47 +02:00
José Valim
40153b7422 Add tests to previous commit. 2011-04-21 13:56:10 +02:00
Alexander Dreher
fdfe6a8340 Fixes error on missing reset_password_sent_at column.
If the column is not present, you are unabled to reset your password.
2011-04-21 19:51:12 +08:00
Carlos Antonio da Silva
79c100008a Remove old OmniAuth test helpers 2011-04-19 13:13:29 -03:00
José Valim
f132c7891b Update CHANGELOG, bump to 1.4.0.dev. 2011-04-19 14:24:33 +02:00
José Valim
bdad984ace Use Devise::Email::EXACT_PATTERN. 2011-04-19 14:22:14 +02:00
Rodrigo Flores
a229627a54 Removed failing test cases on e-mail validations 2011-04-19 20:16:20 +08:00
Rodrigo Flores
0b598cf132 Changed the e-mail validation regex 2011-04-19 20:16:19 +08:00
Rodrigo Flores
0e657eece1 Added email validation regexes 2011-04-19 20:16:19 +08:00
José Valim
b6cf1df659 Release 1.3.1. 2011-04-19 10:39:56 +02:00
José Valim
29afe2d21c Other minor improvements in the REST code. 2011-04-19 08:36:52 +02:00
José Valim
a722c6236c to_json does not guarantee the order. 2011-04-18 13:03:31 +02:00
José Valim
14aedc416a Wording. 2011-04-18 10:03:39 +02:00
José Valim
9fe0cb4954 use @example.com 2011-04-18 10:00:00 +02:00
SixArm
2a5669967f Change test email addresses to ues RFC 2606 reserved domain example.com 2011-04-18 15:59:13 +08:00
durrantm
13376d22de Edited README.rdoc via GitHub 2011-04-18 15:58:40 +08:00
José Valim
6b21531916 Update CHANGELOG. 2011-04-18 09:56:44 +02:00
José Valim
4a4dcb30ef sessions/new also responds to xml and json now 2011-04-18 09:56:24 +02:00
José Valim
2cfa58b433 Create shared_helpers for duplicated logic in Devise controllers and failure app. 2011-04-17 19:43:54 +02:00
José Valim
c6dd846718 Move the catch to the test level. 2011-04-17 19:37:19 +02:00
José Valim
7a2d76d002 Update changelog, improve coverage. 2011-04-17 18:06:29 +02:00
Andre Arko
e5a8febe3b Change the XML error tag from <hash> to <errors>. Makes way more sense. 2011-04-17 23:54:06 +08:00
Steve Hodgkiss
60809719b8 Fix bug when the reset_password_sent_at field doesn't exist generate_password_token returns nil causing the token not to be saved. 2011-04-17 23:53:50 +08:00
José Valim
ee6a8ab93a Temporarily remove rubinius because C extensions are not compiling. 2011-04-17 00:57:02 -07:00
Juan M. Cuello
c3d92095f8 Update README.
Replace success/failure with notice/alert in I18n section.
2011-04-17 15:15:49 +08:00
José Valim
460beae671 Release 1.3.0. 2011-04-16 13:31:50 +02:00
José Valim
fa6c8ab321 Use inflector to avoid conflicts. 2011-04-16 13:30:15 +02:00
José Valim
d02f86bef5 Update changelog. 2011-04-16 13:19:29 +02:00
José Valim
0d74c1b4f0 Move it to the junk drawer. :) 2011-04-16 13:18:28 +02:00
José Valim
8f3539c14f Don't include the same module several times, closes #765. 2011-04-16 13:16:47 +02:00
José Valim
3d5e692c2c Update CHANGELOG. 2011-04-16 13:16:47 +02:00
Jack Dempsey
cb622e99d8 create new integration test file for flash related tests 2011-04-16 19:16:34 +08:00
Jack Dempsey
567d59e48a update verbiage to be more concise 2011-04-16 19:16:33 +08:00
Jack Dempsey
f89f71262d require_no_authentication now sets flash with I18n message 2011-04-16 19:16:33 +08:00
José Valim
5e2ee5eb6a Downcase keys before validation. 2011-04-16 12:52:59 +02:00
José Valim
34a54dac2d Simply check instead or rescueing. 2011-04-16 12:43:43 +02:00
Mikel Lindsaar
e329930a82 Update DatabaseAuthenticatable#valid_password? to not raise error on empty password
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-04-16 12:41:49 +02:00
José Valim
3940846d79 Update CHANGELOG. 2011-04-15 10:58:27 +02:00
José Valim
c608fbe89e Rollback to require 'test_helper'. If you want to run it in isolation, do ruby -Itest path/to/test/file. 2011-04-15 10:48:44 +02:00
Matias Korhonen
8db00eedea Bump the password maximum length to 128 characters. 2011-04-15 16:39:01 +08:00
John Wilger
0e904dda79 Make it possible to unit-test extensions to Devise::SessionsController
This time with tests
2011-04-15 16:37:15 +08:00
John Wilger
e4af6adaf7 Added test showing previously incorrect behavior of Devise::SessionsController#create 2011-04-15 16:37:15 +08:00
John Wilger
e1c7c49a0c Fix test_helper require so file can be run individually 2011-04-15 16:37:14 +08:00
Hiroki Yoshioka
bd9f148d24 Allow to override the path after resending confirmation instructions. 2011-04-15 16:32:41 +08:00
José Valim
f009011179 Update docs. 2011-04-15 10:31:58 +02:00
Timo Schilling
5adb854aa5 add devise_for :only option
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-04-15 10:31:01 +02:00
José Valim
1f51524bae Edited README.rdoc via GitHub 2011-04-11 01:26:36 -07:00
Casper Klenz-Kitenge
23f8dbed80 Removed notice about using Devise from the git repo, for OAuth support. 2011-04-11 16:24:39 +08:00
José Valim
140acfe4cc Improve error message, closes #974. 2011-04-09 22:52:31 +02:00
Jared Beck
cb2cb2cff7 more helpful message re: secret_token 2011-04-10 04:47:55 +08:00
José Valim
30300fc6b9 Add a test that ensures validation options work. 2011-04-09 22:47:06 +02:00
José Valim
de8982563a Always use :erb. 2011-04-05 22:06:27 +02:00
Kim Joar Bekkelund
e7154b3af9 Add missing action to root_path in readme
On ruby-1.9.2-p136 I got the following error when using `root :to => "home"`:

    actionpack-3.0.5/lib/action_dispatch/routing/mapper.rb:171:in `default_controller_and_action': missing :action (ArgumentError)

Specifying the action solves the problem.
2011-04-05 05:47:10 +08:00
Josh Kalderimis
39360dc419 lets have travis test against many rubies 2011-04-05 02:35:28 +08:00
José Valim
eeb61929ac Be sure request.format is not nil (only reproducible in Rails < 3.0.4). 2011-04-04 07:04:32 -07:00
José Valim
56fd7031e5 Edited lib/generators/devise/views_generator.rb via GitHub 2011-04-04 02:48:41 -07:00
José Valim
425fe7f22d Remove old autoload. 2011-04-01 02:42:06 -07:00
José Valim
ed51fc7636 Tidy up previous commits. 2011-03-30 15:35:38 +02:00
Jean-Daniel Guyot
d23a7ca8d5 Copy-paste error 2011-03-30 21:11:34 +08:00
Jean-Daniel Guyot
1b1dc2a429 typo 2011-03-30 21:11:34 +08:00
Jean-Daniel Guyot
be2aeee70f Add reset_password_within configuration variable. 2011-03-30 21:11:33 +08:00
José Valim
8a3deb98cd Add a descriptive text for those upgrading. 2011-03-30 14:40:03 +02:00
José Valim
e4902143f8 Ensure configuration options are allowed exactly after each module is included. 2011-03-30 14:33:56 +02:00
José Valim
d3a374777b Update CHANGELOG 2011-03-30 14:10:59 +02:00
José Valim
5b94d9b803 Refactor a bit navigational format responses, to not call to_sym and reuse the request_format logic from FailureApp. 2011-03-30 14:09:12 +02:00
Prem Sichanugrist
b6652abc7c Add navigational_formats internal helper which filters out wildcard
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-03-30 13:43:57 +02:00
Prem Sichanugrist
97f0bacfa0 Add support for non-navigational formats in PasswordsController
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-03-30 13:39:08 +02:00
Prem Sichanugrist
210bc6aa66 Add support for non-navigational formats in UnlocksController
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-03-30 13:38:16 +02:00
Prem Sichanugrist
8170d5e340 Add support for non-navigational formats in ConfirmationsController
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-03-30 13:38:00 +02:00
Prem Sichanugrist
6225902034 Add support for non-navigational formats in RegistrationsController
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-03-30 13:37:41 +02:00
Prem Sichanugrist
0487e9eafe Add support for destory_user_session_path in another non-navigational formats such as JSON and XML
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-03-30 13:36:50 +02:00
José Valim
73669e09c8 Remove deprecations, bump to .dev and update template. 2011-03-28 21:26:53 +02:00
José Valim
da510508bb Release 1.2.0 2011-03-25 15:53:59 +01:00
José Valim
02ae0c22ef Update CHANGELOG. 2011-03-25 15:40:46 +01:00
José Valim
edee511cd1 Rename active? to active_for_authentication? 2011-03-25 15:40:46 +01:00
Jack Dempsey
fbd35ec332 new cache api requires passing a key to get 2011-03-25 06:38:26 +08:00
José Valim
30b35e3727 Fix syntax error. 2011-03-24 20:25:54 +01:00
Jack Dempsey
330cafd3d2 use reference if available otherwise ref 2011-03-25 03:16:41 +08:00
Jack Dempsey
fe9024218c ref will be reference in 3.1 2011-03-25 03:16:40 +08:00
José Valim
0c9bd3259e 2011-03-23 10:21:11 -07:00
José Valim
b23e2e807a Note about navigational formats. 2011-03-18 16:04:52 +01:00
José Valim
7876acf960 Oops, fix silly mistake. 2011-03-16 05:52:53 -07:00
José Valim
74166e224b Faster uniqueness queries, closes #917 2011-03-15 12:53:17 +01:00
José Valim
cb778d033f Squeeze "/" 2011-03-14 11:04:51 -07:00
José Valim
1bf7da148a Properly ignore path prefix on omniauthable 2011-03-14 18:35:06 +01:00
José Valim
d58a72ee32 Remove stuff deprecated on .rc2 2011-03-14 11:22:09 +01:00
Vinicius Baggio
15d195d2f0 Fixing OmniAuth integration tests since now it has support for failure scenarios 2011-03-12 13:58:19 -03:00
José Valim
4f093574da Release 1.2.rc2. 2011-03-11 20:56:50 +01:00
José Valim
64457e2c1f Update to latest omniauth. 2011-03-11 20:55:36 +01:00
José Valim
3f4fb1a769 Improve previous patch. 2011-03-11 20:46:08 +01:00
gilles
1982ad9f57 fix for possible injection with mongo
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-03-11 20:24:24 +01:00
José Valim
569d205ca7 Gemfile.lock, Y U CHANGING? 2011-03-11 20:17:02 +01:00
José Valim
63b72cd512 Edited app/helpers/devise_helper.rb via GitHub 2011-03-06 05:25:09 -08:00
Michael Klaus
bb89ca4865 Added link to i18n wiki page. 2011-03-06 14:30:07 +08:00
José Valim
307fe6cb60 Revert two previous commits. Rails is broken, it needs to be fixed instead. 2011-03-02 10:13:38 +01:00
José Valim
fe2d7b5ffe Don't cache variable otherwise reloading in development is busted. 2011-03-02 00:16:09 -08:00
Jan Xie
d445db9e5e use Inflector#constantize to get class, compatible with rails edge commit 7b6bfe84f332a3c99656f73cf0251bce0a16ba88 2011-03-02 16:13:15 +08:00
Guilherme Silveira
e4cae200f4 simplifying comparisons (avoind too much negatives) and adding unit test cases 2011-02-27 15:14:02 +08:00
José Valim
a535b047ff Add .travis.yml configuration. 2011-02-25 22:25:34 +01:00
Vinicius Baggio
aa81df261c Warn about an incompatibility between Devise and Mongoid 2011-02-25 18:17:14 -03:00
Vinicius Baggio
0cc900e7cf Reset lock attempts count when lock is expired. Closes #825 2011-02-25 17:59:27 -03:00
Vinicius Baggio
9bff1cf658 Fixing assertion in integration test 2011-02-25 14:57:49 -03:00
Vinicius Baggio
305059f573 Consider SCRIPT_NAME on omniauth url helper. Closes #876 2011-02-25 14:20:12 -03:00
José Valim
392e664036 Be sure to halt on failures, closes #856 2011-02-24 22:31:48 +01:00
José Valim
43a3431c3e Add a test to ensure user.remember_me = true followed by a sign in sends the cookie, closes #776 2011-02-24 22:24:21 +01:00
José Valim
930d5874ca Raise here instead of a warning. 2011-02-24 22:12:54 +01:00
José Valim
3375985ab8 Update CHANGELOG. 2011-02-24 21:58:51 +01:00
José Valim
2e43944567 Move rememberable back to a hook. 2011-02-24 21:55:52 +01:00
Vinicius Baggio
352edc024b Cleaning up test helpers related to OmniAuth.
Developers should rely on OmniAuth's new testing API. Check
https://github.com/intridea/omniauth/wiki/Integration-Testing
for more details.
2011-02-24 16:50:22 -03:00
Vinicius Baggio
b5e289c9a8 Updating bson_ext gem version 2011-02-23 14:34:15 -03:00
Vinicius Baggio
42d002702c Considering namespaces while generating the routes. Closes #682 2011-02-23 14:24:47 -03:00
Vinicius Baggio
6bd65209d5 Added a test case for Devise Generator 2011-02-23 14:24:47 -03:00
Vinicius Baggio
970457f2c2 Fixing test error when dealing with multiple time zones 2011-02-23 14:24:42 -03:00
Alexander Uvarov
bbaaefa995 Relax dependency on ActiveModel::Dirty
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-02-18 12:28:56 +01:00
Joey Aghion
fdf6a48a7e Custom failure apps no longer ignored in test mode. 2011-02-18 15:53:04 +08:00
José Valim
7113beac81 Bring back behavior for < 3.0.4. 2011-02-16 20:59:58 +01:00
José Valim
0c5acc6f38 Update CHANGELOG. 2011-02-15 11:35:24 +01:00
José Valim
dd721f1857 Use secure compare as well. 2011-02-15 11:33:54 +01:00
José Valim
ae75186c52 Update CHANGELOG. 2011-02-15 10:59:41 +01:00
José Valim
ca293d17ba Implement Rails' handle unverified request. 2011-02-15 10:58:38 +01:00
José Valim
add8f8a203 Works on 3.0.4. 2011-02-15 10:27:34 +01:00
José Valim
6a6ed6702e Improve tests and update CHANGELOG. 2011-02-15 10:07:08 +01:00
Nate Todd
2d0f887ba7 Preventing timeoutable from interfering with stateless tokens.
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-02-15 09:54:13 +01:00
José Valim
3109b0924b Remove --haml and --slim views from Devise. 2011-02-15 09:49:11 +01:00
José Valim
bbafb70655 Update CHANGELOG. 2011-02-15 09:45:37 +01:00
José Valim
aac9c40cba Ensure after hooks are called on registrations controller, closes #852 2011-02-15 09:41:35 +01:00
Jo Liss
f964ea526b Skip test that fails with Mongoid.
The test suite passes now.
2011-02-10 23:00:14 +08:00
Jo Liss
bca43a7576 Require 'rails' in devise.rb.
This way we can require 'devise' without requiring 'rails' beforehand.
2011-02-10 23:00:13 +08:00
Jo Liss
8440ed0101 Make Devise::friendly_token 20 characters long.
This makes the tokens better suited for URLs in plain-text emails, and
is still secure for all practical purposes.
2011-02-10 21:42:58 +08:00
Jeffrey Jones
cb5e0c4a7b Simplified logic for checking if the email is present and moved the Mongoid classes out of eval statements 2011-02-10 16:16:33 +08:00
Jeffrey Jones
0287d8cc80 When using database_authenticatable Devise will now only create an email field when appropriate.
(If using default authentication_keys or custom authentication_keys with email included)

Test written for Mongoid, not sure how to test for active_record yet.
2011-02-10 16:16:33 +08:00
José Valim
a48c815dc8 Update CHANGELOG. 2011-02-09 10:13:08 +01:00
José Valim
f332d7e932 Add a test to show recoverable works as expected if password is blank. 2011-02-09 10:11:48 +01:00
José Valim
a14b833581 Update Copyright years. 2011-02-09 00:02:54 -08:00
Carlos Antonio da Silva
c9fe8885f9 Spaces 2011-02-06 19:23:36 -02:00
Carlos Antonio da Silva
e1c3b915e7 Remove require to rake and devise version from Rakefile 2011-02-06 19:19:28 -02:00
Nico Ritsche
f06bed279a corrected 'an user' to 'a user' in comments and docs 2011-02-06 23:46:49 +08:00
Julien Desrosiers
3fd206c591 update README to add ruby_parser as a dependency for generating the Haml templates 2011-02-06 03:06:57 +08:00
John Plummer
7a1852e9f5 Allow send confirmation to change keys used 2011-02-05 16:19:01 +08:00
José Valim
76a4800446 Words. 2011-01-31 15:16:58 +01:00
José Valim
5f93d8355c A tip for newcommers. 2011-01-31 14:06:35 +01:00
Carlos Antonio da Silva
1f8909458f Fix typo 2011-01-26 22:26:40 -02:00
José Valim
68f699bfd4 Do not change default behavior of previous apps. 2011-01-21 10:55:40 +01:00
José Valim
0615c0a0a4 Fix infinite redirect issues. Closes #787 and closes #795. 2011-01-20 09:22:41 +01:00
José Valim
c78bb68c66 Revert "Fix an issue causing infinite redirects in production, closes #720"
This reverts commit a156576ce9.

Conflicts:

	lib/devise/controllers/internal_helpers.rb
2011-01-20 09:16:44 +01:00
José Valim
d018970c4b Revert "Doh. Use respond_to :all."
This reverts commit 555435e6fe.
2011-01-20 09:14:38 +01:00
Jo Liss
971f68f97d README: Call the Google Group a mailing list; merge Testing section into Contributing; minor fixes for consistency. 2011-01-16 01:35:53 +08:00
Jo Liss
4207c2321f Fix the module sorting in devise method. 2011-01-15 07:38:06 +08:00
Jo Liss
54dc82ad25 Generate add_index for :authentication_token (used by :token_authenticatable). 2011-01-15 06:42:30 +08:00
Jo Liss
fa239b984a Do not silently ignore invalid modules passed to devise method in model.
The & operator seemed to be only used to force sorting, but as a
side effect we got suboptimal error handling.
2011-01-15 06:42:29 +08:00
Jo Liss
692f7b27ff typos (remaining instances of authenticable -> authenticatable) 2011-01-13 13:02:17 +08:00
Jo Liss
258eb1c7e6 Move config.pepper from encryptable into database_authenticatable section in the initializer.
config.pepper is used by both database_authenticatable and encryptable,
but encryptable requires database_authenticatable anyway, so it makes
more sense to have it in the database_authenticatable section.
2011-01-13 13:02:17 +08:00
Jo Liss
aa61034d40 Add Testing section to README (issue #766). 2011-01-13 13:02:16 +08:00
Jo Liss
42f2196d01 Rakefile: exit on failing test
And the world can always use more snark. ;-)
2011-01-12 00:53:47 +08:00
vagmi
d87521723d fix create_haml_views. see issue 761 for details
accessing a variable before assigning causes nil exception
2011-01-11 19:06:48 +08:00
siong1987
6e91edd5e3 failure_app redirects to the correct format if it is a non-html request. This is to ensure that firefox redirects the correct format since firefox doesn't inherit accept info. also fix issue 675 that is resurrected by issue 754. 2011-01-11 18:27:14 +08:00
Andrés Mejía
fb4ec6e9da Fixing parameters for _omniauth_authorize_path method after short-circuiting it. 2011-01-08 02:37:05 +08:00
José Valim
7ff0231ab7 Don't pass options forward, this fixes uncaught warden error. Unfortunately could not write a test for it, although easily reproducible in Rails applications. Closes #754 2011-01-03 16:25:23 +01:00
Carlos Antonio da Silva
3f086656aa Fix RegistrationsController routes comments 2011-01-02 20:17:48 -02:00
Carlos Antonio da Silva
55cb7195b8 Implicit self 2011-01-02 20:13:37 -02:00
José Valim
555435e6fe Doh. Use respond_to :all. 2010-12-30 14:49:15 +01:00
Richard Aday
88d4aca2c4 Adding tests for reset_password_keys and unlock_keys 2010-12-30 03:11:03 +08:00
Richard Aday
038eb321d4 Allowing reset_password_keys and unlock_keys to be set through the config 2010-12-30 03:10:56 +08:00
José Valim
c8c84c77c6 Respond to all formats if none is specified. 2010-12-29 16:01:11 +01:00
José Valim
8f20b13f84 By default, just require e-mail on recover and lockable. 2010-12-28 23:00:23 +01:00
José Valim
af1295284c rememberable cookie now is httponly by default 2010-12-25 12:04:04 +01:00
JamesFerguson
1b43cb5203 Added assertion testing that remember_user_token cookie is flagged as HttpOnly.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-12-25 11:49:40 +01:00
José Valim
b34f456096 Invoke callbacks using the correct API 2010-12-25 11:41:14 +01:00
Josh Starcher
e95eb93eb7 added failing test for Warden before_failure hooks 2010-12-25 18:21:20 +08:00
Josh Starcher
1a2590dc08 Warden before_failure hooks are an array, not a proc 2010-12-25 18:21:20 +08:00
José Valim
1cdb02bd54 More tiny fixes 2010-12-25 11:15:56 +01:00
José Valim
7759c8b3f3 Update CHANGELOG 2010-12-25 11:11:56 +01:00
José Valim
b32883a7c5 Small fixes in views generator 2010-12-25 11:07:52 +01:00
José Valim
27051cb2fe responder formats should be inherited from ApplicationController 2010-12-25 11:04:39 +01:00
Prem Sichanugrist
e8e3df3891 Add support for non-navigational format response to SessionsController
This will make Devise::SessionsController return the authenticated object in the requested format instead of redirect the client to another page upon success authentication.
2010-12-25 17:57:15 +08:00
Fred Wu
2561cd4eac Use an instance variale when removing the temp directories otherwise the create_haml_views method gets called twice. 2010-12-23 17:05:05 +08:00
Fred Wu
146090f86e Added more clarification for the devise:views generator. 2010-12-23 17:05:05 +08:00
Fred Wu
4519364eaf Added support for generating Slim view templates. 2010-12-23 17:05:03 +08:00
Uģis Ozols
f56c588a6a Fix typo. 2010-12-23 15:48:03 +08:00
siong1987
379d8c69a5 Issue 675: recall option is now passed for not confirmed email and inactive account. 2010-12-23 02:24:26 +08:00
José Valim
13e8bc22e3 Move duplicate sign_in logic to sign_in(). 2010-12-20 10:02:27 +01:00
José Valim
c27bc21af9 Update CHANGELOG. 2010-12-18 09:39:55 +01:00
José Valim
a156576ce9 Fix an issue causing infinite redirects in production, closes #720 2010-12-18 09:38:41 +01:00
José Valim
b942520dc4 No need to use expand_path as we assume the test directory is in the . 2010-12-18 08:22:01 +01:00
Andrés Mejía
a2e92a2ef2 Adding mongoid generator tests. 2010-12-18 15:15:43 +08:00
Andrés Mejía
60be68436b Adding tests for Active Record generator 2010-12-18 15:15:43 +08:00
Andrés Mejía
fe4eaf2d12 Invoking the model generator even if the model exists but only when the behavior is :revoke (i.e. we are running 'rails destroy' instead of 'rails generate') 2010-12-18 15:15:42 +08:00
Andrés Mejía
845c186f48 Removing caching from #model_exists? so it doesn't return a false positive when the method is called, the file is deleted and then the method is called again. 2010-12-18 15:15:42 +08:00
José Valim
9f832d2cb2 Remove Jeweler. 2010-12-16 16:37:42 +01:00
José Valim
a23a52b2f7 Update dependencies versions. 2010-12-11 10:24:52 +01:00
Carlos Antonio da Silva
7ed1fb116f Cleanup requires in generators tests, fixing issue with load error in Ruby 1.9.2 2010-12-09 23:52:30 -02:00
José Valim
b50fd1a72e Fix e-mail regexp. Closes #698 2010-12-01 17:19:45 +01:00
José Valim
2305e8f8cf Improve README. 2010-11-30 14:17:18 +01:00
José Valim
f2f9232b89 Fix typo. 2010-11-30 05:01:19 -08:00
José Valim
cb62597afa Improve messages. 2010-11-30 12:23:09 +01:00
José Valim
089c316f37 Improve message. 2010-11-29 00:56:43 -08:00
José Valim
ec5bfe9119 Ensure to convert keys on indifferent hash. 2010-11-27 19:45:25 +01:00
José Valim
912969b5a0 Update CHANGELOG. 2010-11-27 08:10:44 -08:00
Gavin Hughes
fe5ef25614 Deprecate anybody_signed_in? in favor of signed_in?(nil) 2010-11-28 00:09:23 +08:00
José Valim
1d6944d201 Update gemspec with 1.2.rc release. 2010-11-26 12:19:22 +01:00
Carlos Antonio da Silva
268eae1013 Add update_attribute method to Mongoid Shim for devise tests, to fix failing test
Mongoid does not have this method in the current beta version (2.0.0.beta.20).
2010-11-26 01:14:27 -02:00
Carlos Antonio da Silva
eb7760b4b2 Make sure to load test gems only in Devise test env 2010-11-26 00:55:16 -02:00
Carlos Antonio da Silva
112f499937 Use UTC for Mongoid timestamps, so it conforms with AR. 2010-11-26 00:54:08 -02:00
Carlos Antonio da Silva
a582d4dca1 Configure Gemfile to use Rails 3.0.x. Also bump mongo related and webrat gem versions 2010-11-26 00:53:57 -02:00
José Valim
4977bd1222 Fix indifferent access on session issue. 2010-11-25 00:06:39 +01:00
Carlos Antonio da Silva
ed30114bd8 Fix changelog e cleanup white spaces 2010-11-21 11:25:37 -02:00
José Valim
71450998c5 Avoid session fixation attacks. 2010-11-20 23:18:41 +01:00
José Valim
6f205fe4c4 Tidy up. 2010-11-20 21:44:53 +01:00
Steve Ross
4a8f9a9ba8 set_flash_message: Added conditional to make certain flash entries are not set if message is blank.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-20 21:42:25 +01:00
José Valim
d8016ea3fd Ensure namespaces has proper scoped views, closes #654 2010-11-20 21:41:26 +01:00
José Valim
6bfcbeffdd Tidy up and update CHANGELOG. 2010-11-20 21:19:12 +01:00
José Valim
094790295c Merge remote branch 'adahl/master' 2010-11-20 20:57:02 +01:00
Andrew Dahl
8d1e23c67d add unit and integration tests for case insensitive keys 2010-11-20 15:54:01 +01:00
Andrew Dahl
e911abf13b changed case_insensitive_keys config setting to an array and added downcasing of keys as a before filter on database authentication module 2010-11-18 23:29:53 +01:00
Andrew Dahl
26b1bc4107 Revert "remember to downcase on registration"
This reverts commit 0c0444c078.
2010-11-18 22:28:23 +01:00
Andrew Dahl
0c0444c078 remember to downcase on registration 2010-11-18 21:58:00 +01:00
Andrew Dahl
94c666e439 first attempt 2010-11-18 21:24:42 +01:00
José Valim
67645c68f7 Move extra helpers names to the bottom. 2010-11-15 06:55:47 -08:00
Romain Pechayre
13968f49af Updated README for better layout of modification of previous commit 2010-11-15 22:54:02 +08:00
Romain Pechayre
1b05d8c3bd Updated README to remove unclarity about user autogenerated helper methods 2010-11-15 22:54:02 +08:00
Andrés Mejía
020f919dcd Tpyo. 2010-11-15 18:35:15 +08:00
José Valim
b70b72b6b0 Rollback to use the regexp result. 2010-11-15 10:01:45 +01:00
Denis Hennessy
19219cbe0f Fix for HTTP Basic Auth when base64 encoded string wraps
When using a token longer than approximately 45 characters, the base64 encoded string passed in
the HTTP_AUTHORIZATION header will contain newline characters. The existing implementation used
a regex which didn't handle this case correctly.
2010-11-15 16:40:39 +08:00
Robert Peters
32c6f7b00b For #646 - modify the configuration text that is output for confirm_within so that it matches the actual default value. If you use nil as a value, it crashes trying to call nil.ago 2010-11-13 15:50:33 +08:00
José Valim
67a49f3b75 Ensure authenticatable_salt can be nil. 2010-11-11 22:51:39 +01:00
José Valim
14d772972d No need to set a pepper in a bcrypt world. 2010-11-11 12:54:09 -08:00
José Valim
b2496d1bc1 Smallish updates. 2010-11-11 13:53:52 +01:00
José Valim
2d2c4c63be Update gemspec. 2010-11-11 13:28:25 +01:00
José Valim
c7efb68a77 Devise does not intercept 401 returned from applications anymore 2010-11-09 23:42:14 +01:00
José Valim
2366530d55 Update CHANGELOG. 2010-11-09 23:31:35 +01:00
José Valim
505bd39700 failure_app now properly handles nil request.format 2010-11-09 23:30:53 +01:00
José Valim
07fedb4383 Merge branch 'omniauth' 2010-11-09 22:28:05 +01:00
José Valim
931b902583 Fix failing tests. 2010-11-09 22:27:46 +01:00
José Valim
835d1044ae Fix a problem with IE7 headers. 2010-11-08 22:45:42 +01:00
José Valim
f49efdff13 Update Gemfile.lock. 2010-11-08 22:33:13 +01:00
José Valim
1f44c61d08 Improve error messages, closes #574 2010-11-06 08:54:03 +01:00
José Valim
ad8d2d7d99 Be more helpful in the already confirmed message, closes #613 2010-11-06 08:54:03 +01:00
José Valim
74edcb8bec Add test/tmp/* to gitignore. 2010-11-06 08:54:03 +01:00
stJhimy
e8dd48c824 Added test for Devise::Generators::ViewsGenerator with scope
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-06 08:54:03 +01:00
stJhimy
0948334393 Added test for Devise::Generators::ViewsGenerators with no params
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-06 08:54:03 +01:00
stJhimy
3b1f1ea719 Added test for Devise::Generators::InstallGenerator
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-11-06 08:54:03 +01:00
Mike Gehard
9b468816dd Add in some instructions for getting routes to a custom action on a Devise override controller 2010-11-06 15:52:29 +08:00
José Valim
4210499f7f Improve error messages, closes #574 2010-11-05 10:08:38 -02:00
José Valim
2aeaf4b109 Be more helpful in the already confirmed message, closes #613 2010-11-05 10:03:52 -02:00
bUg
ab033ea986 fix for omniauth 0.2.0 2010-11-04 08:21:34 +08:00
David A. Cuadrado
09a46695f2 omniauth route should not add a ? if no param is given 2010-10-31 03:06:53 +08:00
David A. Cuadrado
bf19b15914 added open id support via omniauth 2010-10-31 03:06:52 +08:00
bUg
94622054de tests for Devise::Mapping.find_by_path! 2010-10-30 08:57:14 +08:00
bUg
c429fe8d1c fixed bug 'Could not find a valid mapping for path /users/auth/:provider/callback' when devise_for called inside scope 2010-10-30 08:57:13 +08:00
bUg
d8f33b8925 omniauth routes fix, see devise issue #600 2010-10-29 20:48:40 +08:00
José Valim
e30c0f3319 Do not automatically set filter_parameters. 2010-10-26 18:07:06 -02:00
José Valim
976d77defe Add test/tmp/* to gitignore. 2010-10-26 18:01:23 -02:00
stJhimy
4b776c4910 Added test for Devise::Generators::ViewsGenerator with scope
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-10-26 18:00:45 -02:00
stJhimy
f53f02f385 Added test for Devise::Generators::ViewsGenerators with no params
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-10-26 18:00:39 -02:00
stJhimy
b3d3deb12f Added test for Devise::Generators::InstallGenerator
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-10-26 18:00:33 -02:00
bUg
6b04312be5 get -> match for omniauth callbacks
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-10-26 17:55:18 -02:00
José Valim
31edd76369 Remove crazy controllers handling code. 2010-10-18 15:01:38 +02:00
José Valim
3d1152fb8f Update README and CHANGELOG. 2010-10-18 15:01:38 +02:00
José Valim
ca038677f2 Update gemspec. 2010-10-18 15:00:34 +02:00
José Valim
3e38043085 Properly handle failure. 2010-10-18 15:00:34 +02:00
José Valim
611261c64e More tests for Omniauth. 2010-10-18 15:00:34 +02:00
José Valim
2f360bf201 Remove OAuth2 in favor of OmniAuth. 2010-10-18 15:00:34 +02:00
José Valim
5d4e4fbb88 Automatically set OmniAuth path prefix 2010-10-18 15:00:34 +02:00
José Valim
21d5e50054 Basic omniauth support. 2010-10-18 15:00:34 +02:00
George Guimarães
bca72ddf59 fixing typo and whitespaces 2010-10-16 20:17:39 -03:00
Jared Morgan
0aa21dca4c Use to_adapter.get in Warden::SessionSerializer#deserialize 2010-10-17 04:22:22 +08:00
Jared Morgan
31170b9100 Use to_adapter in two more methods
Authenticatable.generate_token and Warden::SessionSerializer#deserialize
2010-10-17 04:22:22 +08:00
José Valim
cdbd03c45a Simplify I18n lookup. 2010-10-14 14:43:41 +02:00
José Valim
fb81453274 Update Gemfile. 2010-10-14 08:45:17 +02:00
José Valim
8539f5f915 Do not depend on orm_adapter git repo. 2010-10-10 22:06:53 +02:00
José Valim
8a8ba6c70c Depend on ORM Adapter. 2010-10-10 17:51:32 +02:00
José Valim
b409184a98 Update CHANGELOG. 2010-10-10 17:51:32 +02:00
José Valim
e4c5158851 Sign out by default will destroy the existing session. 2010-10-10 17:51:32 +02:00
José Valim
7bc37e5237 Provide a better encryptor message and update Gemfile.lock. 2010-10-10 17:51:32 +02:00
Sean Cribbs
9f032350e3 Use ActiveModel's to_key instead of id.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-10-10 17:51:32 +02:00
José Valim
b4a99f6698 Use gemspec in Gemfile. 2010-10-10 17:51:31 +02:00
José Valim
94ccfc5322 Remove deprecation warnings on Rails 3.1. 2010-10-10 17:51:31 +02:00
Sebastián Gamboa
721843c841 Allow to conditionally skip email validation. 2010-10-05 05:42:20 +08:00
takahashim
a1c80b6211 use I18n'ed header on error messages block 2010-10-04 15:38:07 +08:00
dewski
69ecbd1fa3 removed the occurances of =%> at the end of erb blocks and replaced them with -%> 2010-10-02 05:56:29 +08:00
José Valim
ec5f8ae831 Update RDoc. 2010-09-30 04:47:13 -07:00
José Valim
db1ce8eeb2 Sign up now check if the user is active or not and redirect him accordingly setting the inactive_signed_up message. This commit also moves after_update_path_for to inside RegistrationsController, not allowing it to be overriden inside ApplicationController anymore. 2010-09-30 09:12:00 +02:00
José Valim
e01dccaefb Fix recoverable tests. 2010-09-30 09:05:11 +02:00
Pat Allan
16c39a9f17 Making sure timeoutable respects rememberable if both are loaded. 2010-09-29 15:27:54 +08:00
José Valim
fbb77a6edd Ensure bcrypt also uses pepper for backward compatibility. 2010-09-28 17:45:34 +02:00
Kevin
ab690bf36f Use Rails 3 email_field helper instead of text_field for email 2010-09-28 06:18:05 +08:00
Joey Geiger
c8cb7d270d Use a better label to enforce that you are changing your password to a new one. 2010-09-28 01:26:56 +08:00
José Valim
3e9b2092f8 Regenerate gemspec. 2010-09-27 09:36:09 +02:00
José Valim
ef3480004c Ensure we are pointing to the proper sessions controller on failure. 2010-09-26 21:12:05 +02:00
Carlos Antonio da Silva
ffaba3f1d3 Avoid RAILS_DEFAULT_LOGGER deprecation warning from Webrat
This must be fixed in Webrat.
2010-09-26 14:53:36 -03:00
Carlos Antonio da Silva
f60123ce01 Bump webrat to 0.7.1 2010-09-26 14:45:00 -03:00
Carlos Antonio da Silva
a7cc3388b4 Regenerate devise config file for tests and get all tests green on mongoid 2010-09-26 14:31:08 -03:00
Carlos Antonio da Silva
98e69cfd71 Remove unused options param for token_auth schema, and avoid creating a new hash 2010-09-26 14:08:25 -03:00
Carlos Antonio da Silva
6a09daf570 Don't need to extend ActiveSupport::Concern anymore in oauth helpers 2010-09-26 11:47:56 -03:00
José Valim
fbac68d51a This helpers are useless outside oauth context. 2010-09-26 13:40:09 +02:00
José Valim
2169e5de97 OAuth shortcut should use paths instead of urls. 2010-09-26 13:28:30 +02:00
José Valim
4d8d1f5222 Uncomment pepper in configuration. 2010-09-26 01:44:37 -07:00
Carlos Antonio da Silva
0bc80cec35 Remove autoload for Bcrypt encryptor, it does not exist anymore 2010-09-25 23:14:31 -03:00
José Valim
38f3f6318a cookie_domain is deprecated in favor of cookie_options which uses session_options by default. 2010-09-25 21:13:54 +02:00
José Valim
1dfcbe3bd4 Regenerate gemspec to force latest warden version. 2010-09-25 20:29:33 +02:00
José Valim
531f221be7 Allow :stateless_token to be set to true avoiding users to be stored in session through token authentication 2010-09-25 20:28:14 +02:00
José Valim
617e142e34 Store the salt in session and expire the session if the user changes his password 2010-09-25 17:24:56 +02:00
José Valim
6613653df0 Update CHANGELOG. 2010-09-25 16:10:59 +02:00
José Valim
09088706bb Extract encryptors into their own module for better bcrypt support. 2010-09-25 16:08:46 +02:00
José Valim
31d821c2e0 Allow to Rememberable to work without remember_token relying on salt if possible.
This comes with the benefit that if you change your password, all remember tokens expires, and it also requires one field less in the database.

The downside is that if you want remember_me_across_browser to be false, it won't work unless you use the token. It also requires you to be using database_authenticable.

Using salt is now the default in Devise.
2010-09-25 13:07:24 +02:00
José Valim
1ed674afa8 Use Admin in old rememberable tests. 2010-09-25 12:04:38 +02:00
José Valim
2aa1d2f3b7 Increase the size of the friendly token.
The chance of someone to successfully guess a random token in the website is:

(number_of_users / 2388636399360109977557402041718133080829429159844757507642063199359529632522467783435119230976)
2010-09-25 11:51:57 +02:00
José Valim
c12d75eecf Do not rely on controller being available in params. 2010-09-25 11:22:18 +02:00
José Valim
b6089145c1 Warden 1.0! :mantears: 2010-09-25 11:22:17 +02:00
Carlos Antonio da Silva
d02ea3153b Small doc fix 2010-09-24 08:59:39 -03:00
José Valim
dd11f43014 All tests green on latest mongoid. 2010-09-24 11:30:08 +02:00
José Valim
f96061b350 Update docs and CHANGELOG based on the 1.1.3 release from v1.1 branch. 2010-09-24 09:43:40 +02:00
Carlos Antonio da Silva
aaeb053c1d Update CHANGELOG 2010-09-24 00:15:00 -03:00
Martin Davidsson
ec0e105c52 Incorporate feedback from carlosantoniodasilva and update rememberable
tests
2010-09-24 11:08:59 +08:00
Martin Davidsson
f3e348f6f4 Merge options hash instead of overwriting it
The forgetable hook will delete cookies based on the :scope in an
options hash but it was overwriting the options and setting them to
either an empty hash or a hash with a single :domain key. Because the
:scope was lost, the hook was trying to delete the 'remember__token'
instead of the more typical 'remember_user_token' cookie.
2010-09-24 11:08:58 +08:00
José Valim
589de27bcd Stop using inject({}) to build hashes. It is harder to read and slower. 2010-09-22 23:29:17 +02:00
Trevor Turk
fdb4cd5b38 Major update to README - encourage use of the Wiki 2010-09-22 07:31:31 +08:00
José Valim
d6084ab1f7 Improve CHANGELOG. 2010-09-21 12:09:53 +02:00
Thibaud Guillaume-Gentil
c121d8026e Avoid BCrypt::Errors::InvalidSalt: invalid salt
when password_salt is nil.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-21 12:09:07 +02:00
José Valim
5429f940e7 Refactor code related with authentication keys on password recovery and account unlocking, closes #396. 2010-09-21 12:05:17 +02:00
RStankov
850afec96e make User#send_reset_password_instructions to require all authentication_keys
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-21 11:47:07 +02:00
RStankov
fb86f772e7 make User#send_unlock_instructions to require all authentication_keys
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-21 11:46:57 +02:00
José Valim
b2066cc229 Add request_keys support. Closes #401. 2010-09-21 11:45:44 +02:00
José Valim
fc37436a24 Update CHANGELOG. 2010-09-21 10:52:24 +02:00
José Valim
7c630fdb5e Do not execute Warden::Callbacks on Devise::TestHelpers. Closes #414. 2010-09-21 10:50:01 +02:00
Sam Grönblom
57ab87a1b6 Added four tests related to Warden callbacks
Two tests are to ensure that the callbacks are called at all. The other
two test ensure that the user parameter provided to the callback is not
nil.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-09-21 10:31:09 +02:00
José Valim
ff0b4deb1a Add reply-to to e-mail headers by default. Closes #474 2010-09-21 10:07:02 +02:00
Pat Allan
29e9be92b0 Reworking the internals of Devise::Mailer - mainly so headers can be tweaked without overwriting/rewriting #setup_mail. (I'm using a custom mailer which is a subclass of Devise::Mailer, and want to change headers/templates in some situations - but perhaps this is useful generally). 2010-09-20 21:02:28 +08:00
Carlos Antonio da Silva
0388380614 Small comment fix 2010-09-17 20:58:32 -03:00
takahashim
a9f7b3258a fix TypeError in test_sign_in_with_script_name(AuthenticationOthersTest) 2010-09-16 23:02:49 +08:00
Pelle Braendgaard
7b069e641b Improved test thanks to Jose Valim. 2010-09-14 03:55:10 +08:00
Pelle Braendgaard
2fdb71716f The http authentication code was not checking for the type of authentication in the Authentication header.
This caused issues with OAuth header authentication.
Please note I have added a test but I'm not sure it works right as it doesn't fails without the change :-)
But it does fix failures in the oauth-plugin provider specs using devise.
2010-09-14 03:55:09 +08:00
Carlos Antonio da Silva
5c928df66b Strip some whitespaces 2010-09-09 21:11:23 -03:00
James Miller
0f0eb4e8ce Fix for failed first-ever logins on PostgreSQL where column default is nil 2010-09-02 05:46:56 +08:00
Vinicius Baggio
006f48232f Fixing typo in documentation 2010-09-01 17:50:52 -03:00
Hugo Baraúna
6e71eca2dd Updates the docs link from rdoc.info to rubydoc.info
RubyDoc.info is a new guy in the ruby community that was built to replace Rdoc.info. Actually, RubyDoc.info is a result of the merge betwenn yardoc.org/docs and rdoc.info.
2010-08-31 16:17:17 -07:00
José Valim
31d7020637 Reorganize tests for failure app and add entries to CHANGELOG. 2010-08-31 23:55:25 +02:00
José Valim
c8bd965462 Depend on Rails 3 gem in Gemfile. 2010-08-31 23:47:16 +02:00
Santiago Pastorino
e582112369 set WWW-Authenticate header on http_auth if request is not xhr 2010-09-01 05:35:40 +08:00
Daniel Lopes
736654e1bc adding docs for the namespace behavior 2010-08-31 23:59:50 +08:00
Santiago Pastorino
5fb5efbd42 Returning WWW-authenticate on ajaxs calls depends only on Devise.http_authenticatable_on_xhr config 2010-08-31 23:51:58 +08:00
Brian Rose
bf122d8fea Remove inaccurate documentation regarding confirmable and changing emails. 2010-08-27 20:11:03 +08:00
José Valim
daf4b35f85 Update Gemfile lock. 2010-08-26 11:54:45 -03:00
José Valim
ee49077072 :default options is used, closes #452 2010-08-26 08:30:43 -03:00
Fred Wu
c6002bb9bd Corrected the mongoid git repo. 2010-08-25 23:01:52 +08:00
José Valim
5701542adc Update CHANGELOG. 2010-08-25 08:52:04 -03:00
José Valim
c96e17dd8d Ensure routes works for all rails 3 versions. 2010-08-25 08:51:17 -03:00
George Guimarães
1e17b6a5ec Typo in initializer 2010-08-25 00:41:26 -03:00
José Valim
219c05ce49 Small fix in the README. 2010-08-23 14:02:15 -07:00
José Valim
08da923276 Add more docs to the cancel action. 2010-08-23 13:51:37 -07:00
George Guimarães
a9aab6bd27 Changes the comments in devise initializer to reflect the default options. 2010-08-23 16:50:42 -03:00
José Valim
e1006bd6c6 Merge branch 'master' of github.com:plataformatec/devise 2010-08-23 10:26:52 -03:00
José Valim
b8ab9a835b Disable HTTP Authentication by default. You can turn it on in the initializer. 2010-08-23 10:22:31 -03:00
José Valim
617b95fdcd sign_out_all_scopes is true by default. 2010-08-23 09:18:39 -03:00
José Valim
ab7f3bc175 Added Devise.sign_out_via. 2010-08-23 09:05:40 -03:00
José Valim
3d3bb352fb Update CHANGELOG. 2010-08-23 09:02:57 -03:00
José Valim
731650a0f1 after_sign_in_path_for always receives a resource 2010-08-23 08:56:10 -03:00
José Valim
6754ae761c Update README. 2010-08-17 15:38:07 -07:00
Carlos Antonio da Silva
81c49c69df Fix failing helper test and test descriptions 2010-08-13 09:02:51 -03:00
Martin Rehfeld
f3385e96ab use :sign_out_via to control the method(s) for the destroy_*_session_path route 2010-08-13 19:16:59 +08:00
Martin Rehfeld
f04e633542 provide :sign_out_via option for Devise::Mapping 2010-08-13 19:16:58 +08:00
Fred Wu
701bbf2d3c Updated the views generator to respect the rails :template_engine option. 2010-08-06 18:40:46 +08:00
Carlos Antonio da Silva
01c272c692 Add some tests to helper creation using namespaces, to better show how it works. 2010-08-02 08:52:12 -03:00
José Valim
c0c7aefce4 Smallish update to README. 2010-08-02 13:22:45 +02:00
José Valim
c31b1f2146 Remove skipped handling from OAuth in favor of exceptions and rescue_from syntax. 2010-07-28 21:51:26 +02:00
José Valim
a707423d23 Merge remote branch 'stepheneb/jruby' 2010-07-28 13:36:54 +02:00
Jared Morgan
afaf42df5a Add note to README about dm-devise project 2010-07-28 19:29:46 +08:00
Stephen Bannasch
fcef459db3 updated Gemfile.lock 2010-07-27 15:02:07 -04:00
Stephen Bannasch
cd985667db merge with master 2010-07-27 14:57:17 -04:00
Stephen Bannasch
83dc11df14 Gemfile works with JRuby 1.5.1, tests run
The :mongoid group does not work in JRuby so the group
is only defined for the platform: 'ruby'.

In addition installing ruby-debug in JRuby is a manual process so
only include the dependency if we are using the platform: 'ruby'

Here are the steps necessary to run the devise tests in JRuby
using rvm:

  rvm install jruby
  rvm use jruby@devise --create
  gem install bundler --pre
  gem install jeweler
  bundle install
  rake test
2010-07-27 14:35:18 -04:00
José Valim
e6218b3ac2 Update CHANGELOG from branch. 2010-07-27 16:32:09 +02:00
José Valim
d6c6e7cfe1 Fix generators bug. 2010-07-27 16:14:09 +02:00
José Valim
9d5a5beb59 Register helper_methods on demand. 2010-07-27 15:34:08 +02:00
Pat Allan
0a3099663e Let's just include the test helpers for controller specs, not all specs. 2010-07-27 21:00:57 +08:00
Pat Allan
fd35b36c4a Presumed Markdown syntax - switching inline code to RDoc. 2010-07-27 21:00:56 +08:00
Pat Allan
2d67432c23 Expanding on testing docs a little to be more useful for those using RSpec. ActionController::TestCase doesn't seem to be used in RSpec 2 - and besides, we want the setup method called so Warden is automatically initialised. 2010-07-27 21:00:56 +08:00
José Valim
2308361fe0 Update README about OAuth2 support. 2010-07-26 20:43:51 +02:00
José Valim
817a7802e1 Remove deprecated stuff, tag 1.2.0 as version. 2010-07-26 20:39:40 +02:00
José Valim
33ce94363e Merge branch 'oauth'. Welcome to the future. 2010-07-26 20:34:01 +02:00
José Valim
fefbf51c79 scope_signed_in? helpers now simply delegate to current_scope to improve performance. 2010-07-26 20:33:23 +02:00
José Valim
a36cb6e758 Improve docs for routes customization. 2010-07-26 20:33:23 +02:00
José Valim
3beb6ef1a6 Do not eager load all controllers. Otherwise this will force OAuth to be loaded. 2010-07-26 20:33:23 +02:00
José Valim
ac69078534 Improve TODO. 2010-07-26 20:33:23 +02:00
José Valim
4ac6b6e407 Unit tests for OAuth. 2010-07-26 20:33:23 +02:00
José Valim
9222601c5b Expand README on OAuth testing. 2010-07-26 20:33:23 +02:00
José Valim
4bfa98eb7c More and more tests to DeviseOauth. 2010-07-26 20:33:23 +02:00
José Valim
00c6f583e2 More OAuth tests. 2010-07-26 20:33:22 +02:00
José Valim
adba4e2262 Register cancel route so a shortcut is created. 2010-07-26 20:33:22 +02:00
José Valim
ac8221aca7 Add cancel to registrations controller as a way to delete information from session. 2010-07-26 20:33:22 +02:00
Carlos Antonio da Silva
d0d88cf259 Minor tweaks in OAuth README 2010-07-26 20:33:22 +02:00
José Valim
bd8d11e291 More minor tweaks to README> 2010-07-26 20:33:22 +02:00
José Valim
0d6f303735 Add a small connection stubbing API. 2010-07-26 20:33:22 +02:00
José Valim
ef841ca17d Start to add helpers for OAuth tests. 2010-07-26 20:33:22 +02:00
José Valim
eb3118e89a Add OAuth2 documentation. 2010-07-26 20:33:21 +02:00
José Valim
5d6900dcdb Remove old generators. 2010-07-26 20:32:06 +02:00
José Valim
bd1006d321 Add the possibility to skip OAuth authentication by returning nil from the finder method. 2010-07-26 20:32:06 +02:00
José Valim
17ec0c08ed Expire all /_oauth_token$/ keys in session after sign in, so if two users create accounts in the same session, the facebook account will be linked just to the first one. 2010-07-26 20:32:06 +02:00
José Valim
b31d60ce7c Implement error handling for OAuth. 2010-07-26 20:32:05 +02:00
José Valim
b87dc84079 Add oauth links to default template. 2010-07-26 20:32:05 +02:00
José Valim
0aa41d6388 Tidy up lose ends. 2010-07-26 20:32:05 +02:00
José Valim
8bf6a66e05 Make Devise::Oauth follow the same conventions as Devise::controllers. 2010-07-26 20:32:05 +02:00
José Valim
3ba424774e Remove deprecated code. 2010-07-26 20:32:05 +02:00
José Valim
1a9db03b22 Do not rely on load time anymore. Instead, provide a helper that is called whenever a mapping is given. 2010-07-26 20:32:05 +02:00
José Valim
faf771c798 Add OAuth url helpers. 2010-07-26 20:32:04 +02:00
José Valim
bd8294aecf More OAuth setup. 2010-07-26 20:32:04 +02:00
José Valim
6c5be8dfd5 Initial routes and module setup. 2010-07-26 20:32:04 +02:00
José Valim
9ab64c53f4 Release 1.1.0. 2010-07-26 20:25:28 +02:00
José Valim
c5999c8f61 Tests green on mongoid as well. 2010-07-26 20:25:02 +02:00
José Valim
680f2612f4 Update CHANGELOG. 2010-07-26 11:52:05 +02:00
José Valim
81620fecab More about extend remember period feature. 2010-07-23 23:57:31 +02:00
Trevor Turk
2939a61a49 documentation tweaks for extend_remember_period 2010-07-24 01:06:10 +08:00
José Valim
058d433f28 Add extend_remember_period, closes #340. 2010-07-23 16:32:22 +02:00
Stefan Huber
5aeb8cf1cf small documentation fix 2010-07-23 01:33:08 +08:00
José Valim
abfd7e5a4b Warn in case you are using the previous session schema, closes #386 2010-07-19 00:11:51 +02:00
José Valim
869c658e3b Always loop before generating a token. 2010-07-18 23:32:56 +02:00
José Valim
5e64699a5f Add filters as convenient default. 2010-07-18 12:17:04 +02:00
Jinzhu
aecc014d33 Attributes for devise generator 2010-07-17 15:09:01 +08:00
José Valim
55fd7e3b0a Consider ApplicationController url_options in for PathChecker. 2010-07-16 08:40:21 +02:00
José Valim
b4794e041b Save confirmation token to the database, if one does not exist but was requested, closes #377 2010-07-14 18:03:34 +02:00
Carlos Antonio da Silva
4f6113ab68 Fix docs about after_sign_in_path_for and routes 2010-07-13 22:22:26 -03:00
José Valim
05d23f1a00 Do not check the constant, otherwise class renaming will trigger errors as well. 2010-07-12 10:42:02 +02:00
José Valim
e567c00dd8 Store classes as string in session, to avoid serialization and stale data issues, closes #356 2010-07-12 07:48:19 +02:00
José Valim
ebe3e791d6 Email should be case insensitive, closes #372 2010-07-12 07:29:45 +02:00
José Valim
2602ef41cf Do not add unlock routes unless unlock strategy is email or both, closes #373 2010-07-12 07:24:21 +02:00
José Valim
a87bc4a861 Also pass stretches to salt generation. 2010-07-12 06:59:49 +02:00
José Valim
eca511a8f2 Use confirmed_at as flag. 2010-07-08 08:21:14 +02:00
José Valim
9c5ff02ff1 Update CHANGELOG and tidy up tests. 2010-07-07 21:32:13 +02:00
James Pellow
9f29ca480b Add http_authenticatable_on_xhr option
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-07-07 21:26:29 +02:00
James Pellow
b9df42c350 Add tests for http_authenticatable_on_xhr option 2010-07-08 03:21:13 +08:00
José Valim
bd0e2a3180 devise_for now accepts a block. All routes inside the block uses the scope defined by devise_for.
You are now allowed to do:

  devise_for :users do
    # Non conventional sign_in route
    get "/sign_in" => "devise/sessions#new"
  end

And it should work as expected.
2010-07-07 10:51:14 +02:00
José Valim
750560ae87 Ensure method is always POST on new.html.erb forms, closes #365. Also, start to remove usage of assert_template. 2010-07-06 16:01:22 +02:00
José Valim
e2a4ebce4a Consider script name in PathChecker. 2010-07-06 16:01:22 +02:00
Carlos Antonio da Silva
77b7692b57 Regenerate devise initializar and get rid of some deprecation warnings from Devise and Rails. 2010-07-06 08:40:32 -03:00
José Valim
ae6322efb5 No longer retrieve the user from paths, but use the env hash. This change deprecates use_default_scope.
If you have non conventional routes and want to specify the scope for a controller, you can do that at the router level:

  as :user do
    get "/sign_in", :to => "devise/session#new"
  end

This is saying: when accessing "/sign_in", devise should use the user scope. Meaning that users signed through that form will be signed to the user scope.
2010-07-06 01:33:32 +02:00
Carlos Antonio da Silva
238226e33a Adding a small note about security and issues 2010-07-05 14:26:58 -03:00
José Valim
96a9c88420 Improve docs on finders after taking a look at the wiki. 2010-07-05 19:11:37 +02:00
José Valim
dd612753f9 Extract redirect_url from failure app to its own method. 2010-07-05 15:22:44 +02:00
José Valim
35923c9c69 Move template_paths to its own module. 2010-07-05 13:27:15 +02:00
José Valim
f54013a181 Do not hardcode to devise/mailer in order to allow inheritance to work. 2010-07-05 10:05:08 +02:00
José Valim
1cf77028c1 Bump version to 1.1.0 but do not release yet. We are only using this as flag for those using Devise as git with bundler due to the latest changes. 2010-07-04 17:34:33 +02:00
José Valim
7774accb6c Remove data_mapper support.
Devise 1.1.0 will be released soon. This new version will support activerecord and mongoid as default ORMs. From now on, Devise will prefer ORM extensions as gems since this is the best way to handle dependencies.

For example, to allow Devise to work with Datamapper, it requires at least activemodel, dm-rails and dm-timestamps. If the ORM support comes from Devise gem, we cannot add dm-rails and dm-timestamps as dependencies, relying on the developer and documentation to find these out and install them.

Other ORMs may still be added to Devise, as long as they are supported by the community, extend Devise test suite to have all tests passing and they necessarily use ActiveModel::Validations.
2010-07-04 17:22:57 +02:00
José Valim
6c49b428b3 Add flexibility to devise generators by using ORM hooks. 2010-07-04 17:15:24 +02:00
José Valim
7113dfe93a Ensure to convert template engine to string to properly match haml, closes #359 2010-07-04 13:13:00 +02:00
José Valim
4083d679d4 Add documentation to the new :module method. 2010-07-04 13:11:04 +02:00
José Valim
7a1adbb61e Improve integration of devise with new router scope. 2010-07-04 11:53:12 +02:00
José Valim
18cccae82f Update bundler, Rails and improve tests for previous commit. 2010-07-02 08:12:00 +02:00
klacointe
e9fbb3d7ef fix AbstractController::ActionNotFound when use
route with specific format (ie xml, json...)
2010-07-02 13:25:33 +08:00
José Valim
04c25539c2 Add remember_me to attr_accessible on generation. 2010-07-01 12:38:48 -07:00
José Valim
55bc0ace5a Update CHANGELOG. 2010-07-01 13:58:08 +02:00
José Valim
421256d294 Devise should respect script_name and path_info contracts. This closes #331, a long standing bug with Passenger. 2010-07-01 13:50:05 +02:00
José Valim
8e3ef2a620 Add entry to CHANGELOG. 2010-06-30 12:49:41 +02:00
Trevor Turk
aefcd53765 more tests for remember_across_browsers
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-30 12:42:59 +02:00
Trevor Turk
0eb9208503 changelog note for remember_across_browsers
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-30 12:42:49 +02:00
Trevor Turk
8824b767f3 remember_across_browsers option for rememberable module
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-30 12:42:42 +02:00
José Valim
2103a673f0 Allow devise_for to be scoped with the scope method. This commit requires latest commits in Rails master. 2010-06-30 12:41:44 +02:00
José Valim
78e7642bd2 Tests green again. 2010-06-29 21:41:34 +02:00
José Valim
8526056bde Merge branch 'master' of github.com:plataformatec/devise 2010-06-29 12:02:06 +02:00
José Valim
4b272767d6 Fix a bug in Devise::TestHelpers where current_user was returning a Response object for non active accounts, closes #341. 2010-06-29 11:52:10 +02:00
José Valim
84c34ff0c4 Be more specific about master. 2010-06-28 12:25:03 -07:00
Maxim Filatov
4db3ac820b sign_out_all_scopes is false by default 2010-06-25 02:29:52 +08:00
Maxim Filatov
503d27f2e1 Renew devise:install due to sign_out_everybody => sign_out_all_scopes 2010-06-25 02:29:50 +08:00
Denis Lifanov
2475faf9c7 warden.logout(*scopes) instead of warden.logout(*Devise.mappings.keys) 2010-06-25 02:29:49 +08:00
Denis Lifanov
819db39263 simplification (sign_out_everybody => sign_out_all_scopes) 2010-06-25 02:29:48 +08:00
Maxim Filatov
f864259f1e Added config.sign_out_scoped to devise:install 2010-06-25 02:29:47 +08:00
Maxim Filatov
12ae21117c Missed rdoc 2010-06-25 02:29:46 +08:00
Denis Lifanov
1a224c7486 move sign_out_scoped logic to the Devise::SessionsController#destroy 2010-06-25 02:29:45 +08:00
Denis Lifanov
f10b747f7f Devise.sign_out_scoped option added 2010-06-25 02:29:43 +08:00
Denis Lifanov
8370006591 we should not fetch Devise.mappings.keys twice in #sign_out_everybody 2010-06-25 02:29:42 +08:00
Denis Lifanov
1924a915a8 sign_out_everybody helper (as a convenient proxy to warden) 2010-06-25 02:29:41 +08:00
José Valim
7a45043bc8 Be more friendly if the user goes ahead and adds devise_for :users before defining the model. 2010-06-24 16:51:30 +02:00
Rob Holland
ad63e25c89 config.load_paths is now config.autoload_paths 2010-06-24 19:28:34 +08:00
José Valim
895a7a4951 Use Rails master. 2010-06-23 12:52:44 +02:00
José Valim
b8c2bbe73c Revert "Revert "Track Deprecation of :name_prefix in Rails 3 RC""
Devise master will now follow Rails master.

This reverts commit b2c2cb272f.
2010-06-23 12:42:23 +02:00
José Valim
b76bf10203 Update README. 2010-06-23 12:42:13 +02:00
José Valim
748eced9e8 Release RC2 (for Rails 3.0.0.beta4) 2010-06-23 12:39:04 +02:00
José Valim
a39312e26b Ensure flash messages work with Devise::TestHelper, closes #327 2010-06-23 12:39:04 +02:00
José Valim
b2c2cb272f Revert "Track Deprecation of :name_prefix in Rails 3 RC"
Let's wait until a new Rails 3 release is out before applying this to maintain compatibility with Rails 3 beta 4.

This reverts commit 21874d8559.
2010-06-23 12:39:04 +02:00
José Valim
fccde42f20 Do not show model exist message on revoke behavior, closes #334 2010-06-23 12:39:04 +02:00
Jared Morgan
e90732c8c3 Remove #save! method from test DM User model
DM has a #save! method, so it's no longer needed. Having it call #save
caused #valid? to be called where tests were expecting validations to be
skipped.
2010-06-23 18:38:39 +08:00
bodhi
21874d8559 Track Deprecation of :name_prefix in Rails 3 RC 2010-06-23 14:56:01 +08:00
José Valim
cfadaf80a2 Merge with jm81 and snusnu datamapper forks. 2010-06-22 21:01:37 +02:00
José Valim
df444663ac Bring datamapper Gemfile back. 2010-06-22 21:00:46 +02:00
Jared Morgan
5b63605c94 Add dm-serializer to Gemfile so DM models respond to #to_xml
Fixes 3 Missing template errors
2010-06-22 11:00:36 -05:00
José Valim
3660cbac30 Do not execute after initializers if production. 2010-06-21 14:07:58 +02:00
José Valim
92cf50454b Add Rails 3 + Mongoid example to the README. 2010-06-20 01:29:53 -07:00
Postmodern
29ba790e07 Do not use ActiveRecord only methods in tests. 2010-06-19 17:30:10 -07:00
snusnu
4e2cd157c1 Specs surely don't pass, but they run at least! 2010-06-19 17:30:10 -07:00
snusnu
194959f312 Updated Gemfile to include DataMapper-1.0.0 (from git for now) 2010-06-19 17:30:10 -07:00
José Valim
e3b815de49 Bring encrypted password limit back. 2010-06-18 22:00:31 +02:00
José Valim
ac0105d15f No need to limit password. 2010-06-17 00:36:09 -07:00
Carlos Antonio da Silva
7dbd2eac2a Confirmable is not default anymore, so remove it from generated migration. 2010-06-17 01:57:42 -03:00
José Valim
025c3875b6 Update gemspec, closes #316. 2010-06-13 21:48:43 +02:00
José Valim
f1a990c2ae Do not show messages if eager loading to call help. 2010-06-13 13:34:49 +02:00
José Valim
1f4a31f1cf Update generators to use Rails 3 syntax, i.e devise:install instead of devise_install. 2010-06-13 13:10:33 +02:00
José Valim
31910b85a2 Regenerate .gemspec 2010-06-13 12:40:40 +02:00
José Valim
5e1ef9319e Check if the user is already signing out before timing out his connection, closes #273. 2010-06-13 12:40:13 +02:00
José Valim
70a429d9ff Split tests files a bit. 2010-06-13 12:11:15 +02:00
José Valim
f16d01869a Rename apply_schema to apply_devise_schema and refactor Mongoid part a bit. 2010-06-13 11:48:45 +02:00
José Valim
290cfd1f72 Be more generic on TestHelpers. 2010-06-13 11:09:59 +02:00
José Valim
ed22295963 Fix a couple things based on community feedback (love ya!) 2010-06-13 10:51:46 +02:00
José Valim
a2f84852af Allow the mailer class to be configured. 2010-06-12 20:56:55 +02:00
José Valim
c4a4032b6b Use ActiveSupport::Dependencies.ref to abstract constant lookup logic. 2010-06-12 20:48:37 +02:00
José Valim
80895c3b9a Make I18n key for mailer compatible with lookup shortcuts, closes #245 2010-06-12 20:29:43 +02:00
José Valim
84686d285c Be more clear that Rails 2.3 users should use the v1.0 branch README. 2010-06-12 06:56:15 -07:00
José Valim
6c18c92598 Update gemspec. 2010-06-12 15:30:43 +02:00
José Valim
0333caeb92 Make bcrypt the default encryptor and automatically add a pepper on generation. 2010-06-12 14:46:55 +02:00
José Valim
bece09c653 Comment out datamapper scenario because it simply does not work currently. 2010-06-12 13:30:55 +02:00
SSDany
cd78a26f88 add #anybody_signed_in? to helpers 2010-06-12 05:11:04 +08:00
SSDany
5c9fe5e769 anybody_signed_in? helper 2010-06-12 05:11:03 +08:00
José Valim
fb0aec09f1 Talk about beta 4 in the README. 2010-06-11 09:10:36 -07:00
José Valim
5f2a19d784 Also need a klass reader. 2010-06-09 02:50:45 -07:00
José Valim
cc608f82dd Properly check if devise method is present. 2010-06-09 02:50:28 -07:00
José Valim
7e784b258c Update Devise generator error message. 2010-06-09 02:41:30 -07:00
José Valim
870912d458 beta 4 works, yay. 2010-06-09 01:27:38 +02:00
Lloyd Pick
f0c0f5f11b fixed a few spelling/grammar mistakes 2010-05-28 20:24:39 +08:00
Antonio Tapiador del Dujo
7dc1842cc4 Add note about default routes in devise configuration 2010-05-25 18:58:20 +08:00
José Valim
28b10e397f Update CHANGELOG 2010-05-25 00:03:03 +02:00
Alexander Uvarov
6ff77c9fdf Add merb-auth like router helper 2010-05-25 05:51:32 +08:00
José Valim
d98882d745 Tidy up previous commit. 2010-05-24 22:50:25 +02:00
Joseph DelCioppio
80977c6dee Added after_update_path to registrations controller. Users can now specify the path that their app should return to after updated a resource. If not specified it will return to the root, or the resource's root if specified. 2010-05-25 04:25:32 +08:00
José Valim
7c82d3ee67 Move the generator bit to the top. 2010-05-21 07:42:34 -07:00
José Valim
0150fddb4c Depends on warden 0.10.5. 2010-05-20 01:24:11 +02:00
bodhi
c8ec42a41c Update documentation to track deprecation of :as in #devise_for 2010-05-19 15:50:48 +08:00
José Valim
bff64a6291 Added navigational formats to specify when it should return a 302 and when a 401, closes #234 and #249. 2010-05-16 19:13:38 +02:00
José Valim
a65fd873dd Update CHANGELOG 2010-05-16 14:55:35 +02:00
Paul Rosania
592fa59e88 Automatically create the confirmation_token when email is sent for optionally confirmable models
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-16 14:54:05 +02:00
Paul Rosania
02c2df65cd Mark confirmable roles as active when confirmation_required? is false
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-16 14:53:08 +02:00
José Valim
59bee679ca Add tests to cookie domain, closes #254. 2010-05-16 14:13:56 +02:00
Mantas Masalskis
21129ae38c custom domain cookie support
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-16 12:30:00 +02:00
José Valim
f1bbce58f3 Add tests to previous commit. 2010-05-16 12:14:02 +02:00
Davide Marquês
8e173f486c Enable :registration in the :path_names configuration option.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-16 12:00:43 +02:00
José Valim
e905762611 Clean up the whole loading mess and closes #247. This commit depends on latest Rails. 2010-05-16 00:38:40 +02:00
José Valim
d38421dde8 Green tests on Rails master, closes #261 2010-05-15 10:39:11 +02:00
José Valim
6162e1f5ff Devise install now accepts --orm option. 2010-05-15 10:28:29 +02:00
José Valim
08c5179869 Update registerable on readme. 2010-05-11 02:37:46 -07:00
José Valim
bb39243da2 data_mapper uses underscore (ht: Yehuda Katz) 2010-05-05 02:28:40 -07:00
José Valim
9bdc711324 Update README. 2010-05-03 14:00:32 +02:00
José Valim
a4351b0b77 Update master CHANGELOG. 2010-05-03 13:57:57 +02:00
José Valim
416bff3daa Merge branch 'master' of github.com:plataformatec/devise 2010-05-03 00:12:58 +02:00
José Valim
07204c500d Confirmable is not default anymore. This provides a better bootstrap experience. 2010-05-03 00:08:48 +02:00
gitman
f5bc66521f patch-244 for improving commented help for :confirmable configuration
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-05-03 00:06:16 +02:00
Britto
fb0f8fcd0d typo 2010-04-29 05:45:44 +08:00
José Valim
61fbec858e Add a missing TODO 2010-04-26 07:34:06 -07:00
José Valim
25302de1f8 Add a link to the second screencast to the README. 2010-04-25 10:02:51 +02:00
José Valim
b86c1c241b Use markup in views as Ryan Bates does in the screencast. 2010-04-25 10:02:11 +02:00
José Valim
2bf9e462fa Update CHANGELOG. 2010-04-25 09:59:10 +02:00
Jacques Crocker
57712737b2 Fixing up devise generator for mongoid and datamapper. Will insert devise configuration after the module include so that it works, closes #226.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-25 09:47:14 +02:00
Ryan Booker
c582e9cb0f Fix grammar in notice, closes #229
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-25 09:44:04 +02:00
José Valim
d750b48879 Include model_session helpers in view, closes #227 2010-04-25 09:40:07 +02:00
José Valim
708fe78d86 Ensure password confirmation is always required, closes #228 2010-04-25 09:38:56 +02:00
José Valim
41311eb38d Move mailer configuration to the app. 2010-04-25 09:26:51 +02:00
José Valim
da971e4249 .bundle directory should NOT be ignored. 2010-04-23 13:51:10 +02:00
hpoydar
eb23ca0ca7 Include bson_ext in Gemfile
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-23 13:50:49 +02:00
hpoydar
c9fe7900c3 Removed references to mongo_ext, since mongoid now uses bson_ext
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-23 13:50:41 +02:00
José Valim
9d6a78f7f4 Add ldap_authenticatable to README. 2010-04-22 20:55:27 +02:00
José Valim
4da63c5395 Ensure routes are loaded before application classes are eager loaded, closes #212. 2010-04-22 19:59:52 +02:00
José Valim
b5f892bcdb No need to check if AR is defined. 2010-04-20 17:22:16 +02:00
José Valim
3135487931 More more logic to Authenticatable. 2010-04-16 22:00:06 +02:00
José Valim
9291ab55b8 Fix compatibility with Mongoid and Datamapper, closes #206. 2010-04-15 21:39:56 +02:00
José Valim
1db86a0810 More information about ecosystem in the README. 2010-04-15 21:20:00 +02:00
José Valim
fb832e6ffe Replace devise_for :admin by devise_for :admins. 2010-04-15 11:31:13 -07:00
José Valim
ca6248cfd3 Release devise 1.1.rc1. 2010-04-15 08:45:33 +02:00
José Valim
b9c0676a01 Get rid of deprecation warnings. 2010-04-15 08:43:39 +02:00
José Valim
731f156f50 Do not show unlock link unless strategy is e-mail. Closes #204. 2010-04-15 08:40:15 +02:00
José Valim
b2a50db1df Fix a bug with STI. Closes #195. 2010-04-15 08:34:57 +02:00
José Valim
6bd0c7fc2b :as and :scope in routes is deprecated. Use :path and :singular instead. Closes #199. 2010-04-15 08:21:13 +02:00
José Valim
4e674ab9a0 No need to wait for routes finalization to include UrlHelpers, closes #200. 2010-04-14 08:59:09 +02:00
José Valim
cbfeb59fb3 Regerate gemspec. 2010-04-13 23:44:25 +02:00
José Valim
8db559148c All tests green on latest Rails beta. 2010-04-13 23:28:13 +02:00
José Valim
7403c9f80e Fix a mailer bug in Rails 3. 2010-04-13 23:11:12 +02:00
José Valim
f3d654a733 :activatable is added by default. 2010-04-13 13:35:34 -07:00
José Valim
bafc859f75 Fix small typo in the README. 2010-04-12 10:31:22 -07:00
José Valim
bf63824aae Improve wording in the README. 2010-04-12 04:48:22 -07:00
José Valim
32d37cebed Properly use scope in views generator. 2010-04-12 04:39:16 -07:00
José Valim
d2ebaa43ec Be more helpful in the sign up message for new comers. 2010-04-09 23:13:34 +02:00
José Valim
045af3a614 Change README shown in devise_install. 2010-04-09 09:50:45 -07:00
José Valim
a96fdcf0bd Change authenticatable to database_authenticatable in README. 2010-04-07 22:24:00 -07:00
José Valim
fd934f1434 Revert "Only triggers http in failure app if devise.authentication_method is :http."
It has not fixed the problem it was supposed to fix.
This reverts commit 9d1a52978c.
2010-04-06 22:36:41 +02:00
José Valim
b2fe7e49fd Kill .bundle dir 2010-04-06 17:56:41 +02:00
José Valim
22392f23f2 Authenticatable shuold be loaded at the end. 2010-04-06 17:27:49 +02:00
José Valim
3ce98d4163 Regenerate gemspec. 2010-04-06 16:56:14 +02:00
José Valim
c07b5ae858 :activatable is included by default in your models. If you are building a strategy for devise, you now need to call validate(resource), since Devise has now a default API to validate resources before and after signing them in. You can still use other Warden::Strategies with Devise, but they won't work with a few modules like unlockable (they never did, but now we have a single point to make it work). 2010-04-06 16:34:22 +02:00
José Valim
dbe116c255 Add more info to README. 2010-04-06 13:43:38 +02:00
José Valim
9d1a52978c Only triggers http in failure app if devise.authentication_method is :http. 2010-04-06 13:40:39 +02:00
José Valim
0d3c6b9d99 Small changes to token_authenticatable. 2010-04-06 13:26:56 +02:00
Andre Medeiros
71f74a10f7 Solved deprecation warnings
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-06 12:06:42 +02:00
José Valim
0bd75469ba Update README. 2010-04-05 12:21:02 +02:00
José Valim
1591294b7a Compatibility with Rails beta 3. 2010-04-05 11:46:26 +02:00
José Valim
f9cbd3c457 Add 1.0.6 entries to master changelog 2010-04-03 13:27:17 +02:00
José Valim
66ca9f5ce0 Update README to point to the RC0 gem. 2010-04-03 13:22:14 +02:00
José Valim
d3c31ef16d Releasing 1.1.rc0 which is compatible with Rails 3.0.0.beta2. There is just one known bug with this new Rails version, which means we are close to a final Devise 'Rock Your Socks Off 1.1' version. 2010-04-03 13:20:00 +02:00
José Valim
b974b7bc78 Move failure messages from devise.sessions to devise.failure. 2010-04-03 13:11:45 +02:00
José Valim
23e608e27b No need to append ?unauthenticated=true in URLs anymore since Flash was moved to a middleware in Rails 3. 2010-04-03 11:43:31 +02:00
José Valim
0f7b311171 Add lockable to migration. 2010-04-02 20:36:27 +02:00
postmodern
27c4280eca Expend the length of the encrypted_password field to 128 to allow storing BCrypt or SHA512 passwords.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-02 20:31:33 +02:00
José Valim
1ba525a0e9 Tidying up some lose ends and adding more docs. 2010-04-01 22:11:59 +02:00
José Valim
d8b6ba9022 Bump warden to 0.10.3 2010-04-01 19:24:22 +02:00
José Valim
f5d01c217d TokenAuthenticatable now works with HTTP Basic Auth by default (take a look at Highrise API for a good example). This basically allows you to pass the authentication token as HTTP Basic Auth username. 2010-04-01 19:09:33 +02:00
José Valim
2b5a068246 Move part of the logic in SessionsController#create to the FailureApp. Whenever Warden is invoked with a :recall, the failure app will recall the chosen controller and the action given to recall. 2010-04-01 17:30:55 +02:00
José Valim
13b8ddf54c Ensure customs pass through sessions_controller. 2010-04-01 14:00:21 +02:00
José Valim
16666b7587 Get rid of flash hook and clean up passwords after registration. 2010-04-01 13:23:49 +02:00
José Valim
dac7887d7c Allow the dummy application in test/rails_app to boot. 2010-04-01 12:49:11 +02:00
Fred Wu
42d06a241b Added support for HAML 3+.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-04-01 00:14:16 +02:00
José Valim
3d1a04fd83 Fix warden configuration. 2010-03-31 22:04:48 +02:00
José Valim
1d65a76cf3 Move remember_me hook inside strategies. 2010-03-31 21:43:19 +02:00
José Valim
015c74e734 Use message verifier in cookies. Previous implementation allowed brute force attacks by cookies. Even though it is impossible for the brute force attack to succeed, the current implementation blocks the attacker even before hitting the database. 2010-03-31 13:31:45 +02:00
José Valim
6cc32db2dd Add lock_strategy. 2010-03-31 11:54:11 +02:00
José Valim
597a930c74 We do not use t() helpers in views, so there is no reason why this particular one should use them. 2010-03-30 20:06:56 +02:00
José Valim
d7f614b726 Make config.devise available on config/application.rb 2010-03-30 11:08:16 +02:00
José Valim
e04c5ba977 More work with unlock_strategy equals to none. 2010-03-30 01:58:06 +02:00
José Valim
4fc41dd68a Regenerate gemspec. 2010-03-30 01:50:54 +02:00
José Valim
22e1fa0cb9 Small cleanup. 2010-03-30 00:29:57 +02:00
Josh Kalderimis
a6a018253e minor change to content type checking to make it more flexible when utf8 is returned
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-30 00:23:46 +02:00
José Valim
81926c2cd2 Allow :unlock_strategy to be :none. 2010-03-30 00:07:11 +02:00
José Valim
7d14f0bbb9 Allow several authentications to share a common path. 2010-03-29 23:44:47 +02:00
José Valim
e038d82410 Merge branch 'master' of github.com:plataformatec/devise 2010-03-29 21:02:56 +02:00
José Valim
65b8908960 Create authenticatable base model and strategy. 2010-03-29 20:52:48 +02:00
José Valim
1c5d4771ff Initial work on making the authentication stack more flexible. 2010-03-29 16:13:19 +02:00
José Valim
604b7ef61c Move http authenticatable response to failure app. 2010-03-29 15:16:14 +02:00
José Valim
0d704c02ca Fix link on README. 2010-03-29 00:53:51 -07:00
Jacques Crocker
1c39590e20 Devise / DataMapper updates
allows devise to work with the upcoming dm-validation changes
2010-03-28 20:53:22 -07:00
Jacques Crocker
6d31e368bf Use persisted? instead of new_record?
In order to be more ActiveModel compliant, lets use persisted? whereever we can. Particularly for datamapper, new_record? causes api warnings. Better to stick to the ActiveModel api I think.
2010-03-28 20:53:13 -07:00
José Valim
63deb0e80a Update CHANGELOG. 2010-03-28 23:15:45 +02:00
José Valim
2a082f3e4c Fix some unlockable bugs. 2010-03-28 23:09:28 +02:00
Josh Kalderimis
97b7ba8659 added imapable to the README
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-28 22:02:38 +02:00
José Valim
bc00a13a3a Update gemspec. 2010-03-28 15:24:21 +02:00
José Valim
033db1ca7c Do not depend on silence_missing_strategies! anymore. This speeds up strategies matching because we don't need to check if the model duck types to the strategy and it doesn't trigger uneeded strategies. 2010-03-28 14:55:05 +02:00
José Valim
066c6e8771 Do not force halt on authenticatable. This allows other strategies (like devise_imapable or even devise_facebook_connectable) to hook into sessions controller as well.
Those strategies should follow the same convention, allowing them to be cascated.
2010-03-28 12:52:12 +02:00
José Valim
96c8238b02 Remove duplicated method. 2010-03-28 07:24:56 +02:00
José Valim
4b7a9204b8 More configuration to validatable. 2010-03-28 07:19:23 +02:00
José Valim
ea71be8d2a More compatibility with Rails master. 2010-03-28 07:15:52 +02:00
Jacques Crocker
6bcf18b04f Mongoid support cleanup
moving test specific == override part of the test models and not part of the Compatibility module included in all Mongoid docs. Made sure that nothing in devise itself uses this == between 2 different models, its purely for assert_equal
2010-03-27 16:16:36 -07:00
Jacques Crocker
bb504e08aa Initial Datamapper test suite
Test suite runs, however there's still some failing tests. This allows us to at least have a working test suite so they can fix these datamapper spec failures individually.
2010-03-27 16:15:23 -07:00
Jacques Crocker
afe6a8c8c8 Merge branch 'master' of git://github.com/plataformatec/devise 2010-03-27 16:10:30 -07:00
José Valim
a53cc74fd9 Revert "Move password_required? to authenticatable. This allow you to reuse it when building your own validations."
This reverts commit 386e7be823.
2010-03-27 12:31:38 +01:00
Jacques Crocker
fd035b841b Additional configuration for validatable
Added the ability to customize password length (via Devise.password_length) and the regular expression used for validating email (via Devise.email_regex)
2010-03-26 13:52:12 -07:00
Jacques Crocker
e127463ac8 Adding Mongoid 2.0 Support, Removing MongoMapper for now 2010-03-26 13:37:38 -07:00
José Valim
bd4b29c0fd sign_in_count shoud default to zero. 2010-03-26 12:56:24 +01:00
Carlos Antonio da Silva
6f41284714 Merge branch 'master' of github.com:plataformatec/devise 2010-03-26 08:44:42 -03:00
Carlos Antonio da Silva
a5ba2ac1a8 Use prepend_before_filter in require_no_authentication.
We need to be sure require_no_authentication runs before other user filters that may call some Devise helper (ie current_xxx).

Conflicts:

	app/controllers/devise/passwords_controller.rb
	app/controllers/devise/registrations_controller.rb
	app/controllers/devise/sessions_controller.rb
	app/controllers/devise/unlocks_controller.rb
	lib/devise/controllers/internal_helpers.rb
	test/rails_app/app/controllers/application_controller.rb
2010-03-26 08:26:51 -03:00
José Valim
386e7be823 Move password_required? to authenticatable. This allow you to reuse it when building your own validations. 2010-03-26 12:19:01 +01:00
José Valim
ca4e09390e Compatibility with Ruby 1.9.1 and 1.9.2. 2010-03-26 11:27:19 +01:00
Andreas Haller
5c19605d6f Fixed test: calling Mail::Body#encoded to get a String (Rails 3)
From Rails' CHANGELOG
… Mail.body returns a Mail::Body class object, need to call #encoded or #decoded to get the string you want.

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-26 11:00:46 +01:00
José Valim
e136573905 Improve workflow with devise generator. 2010-03-26 10:36:15 +01:00
José Valim
ae729aedc3 Allow devise to work with association proxies. 2010-03-26 10:19:31 +01:00
José Valim
12b64c691f Add support to multipart e-mails (just put them in your mailers folder) and headers customization by simply defining headers_for in your model. 2010-03-26 10:01:24 +01:00
Josh Kalderimis
4d3a3ceb43 added test to confirm order in ALL is being adhered to when adding and including module in model
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-26 09:31:25 +01:00
José Valim
c76df8239f Require no authentication on unlockable. 2010-03-23 17:56:32 +01:00
José Valim
28a6be456a Require files before monkey patching them. 2010-03-23 16:28:17 +01:00
José Valim
76e45ecb12 Bring unloadable back. 2010-03-23 00:39:27 +01:00
José Valim
8fbbe34bdd Fix routes generation on Rails master. 2010-03-16 14:48:30 +01:00
José Valim
3a84fd4f3f Ensure devise_views is always executed. 2010-03-16 02:51:59 +01:00
José Valim
37bb6948a2 Update README to tell about Rails edge and Devise edge. 2010-03-15 03:21:12 -07:00
Ørjan Blom
f129b9ffd7 don't use a static name in a public directory, and delete after use.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-14 15:02:54 +01:00
Fred Wu
6ce33b7b57 Updated the gem dependencies.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-14 11:22:26 +01:00
José Valim
185541b9e4 Use template engine as option since it's the one used by rails. 2010-03-14 09:39:59 +01:00
Ørjan Blom
e81d428d53 update gem dependencies
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-14 09:28:13 +01:00
Fred Wu
de92be39f2 Use Ruby's tmp directory instead of a ghost directory inside the devise gem folder.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-14 09:25:57 +01:00
Fred Wu
3f85fa88c3 Use 'rescue' to ensure the presence of Haml.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-14 09:25:52 +01:00
Fred Wu
2ebbc30540 Made sure no deprecated HAML templates (in case any) will get copied over.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-14 09:25:45 +01:00
Fred Wu
b8091928a0 A more user friendly way of checking the existence of Haml.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-14 09:25:39 +01:00
Fred Wu
cbd35a846a Added verification for HAML >= 2.3.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-14 09:25:31 +01:00
Fred Wu
90e8253205 Added HAML as a template engine option to devise_views generator (-t or --engine). HAML files are created based on the erb files on the fly using 'html2haml' command that comes with HAML.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-14 09:25:19 +01:00
José Valim
3f0bae1968 Allow to give :skip in devise_for to skip routes for an specific controller. 2010-03-12 09:54:57 +01:00
José Valim
59b26d8427 All tests pass using Rails master. 2010-03-11 18:39:32 +01:00
José Valim
cbc3747039 No need to check if app.routes.url_helpers exists. I.e. Devise master now *requires* Rails master (aka beta1). 2010-03-10 08:59:22 -07:00
José Valim
ed3a460bad Allow to give a scope when copying views. 2010-03-10 16:53:09 +01:00
José Valim
ac742e3271 Clean up lockable and class methods API. 2010-03-10 16:13:54 +01:00
Fred Wu
cd17099401 Create the devise_views directory in './app/views' instead of the root.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-10 15:29:30 +01:00
José Valim
829c85631b Aim for Rails 3.0.0.beta1 compatibility. A few issues are still pending with Warden. 2010-03-10 15:00:12 +01:00
Ørjan Blom
1a740774e3 use Devise.encryptor setting when creating the migration
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-09 10:38:39 +01:00
Philip MacIver
bb9f594cc8 Changed the datamapper orm so that the default value is only deleted when it is nill, this is so that is a value is set to another value except nil by default through devise, that value will be maintained in datamapper
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-06 18:14:37 +01:00
Philip MacIver
d64e146ec9 Modified the datamapper orm so that it actually works with devise
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-03-06 16:18:53 +01:00
Philip MacIver
0a0d7ba577 Typo in the datamapper orm stopped it from being loaded properly
Signed-off-by: Carlos Antonio da Silva <carlosantoniodasilva@gmail.com>
2010-03-04 20:44:09 -03:00
José Valim
288b92d2be Update CHANGELOG. 2010-03-03 12:25:28 +01:00
José Valim
1d4f4c19c9 Release pre4 with improved controller handling. 2010-03-03 12:22:04 +01:00
José Valim
901c6ae4df Always get a new object on edit, update and delete. 2010-03-03 12:12:06 +01:00
José Valim
0e64bc74b7 Move trackabe logic to the model. 2010-03-03 12:03:43 +01:00
José Valim
038627574c Keep modules definition in a different file. 2010-03-03 12:03:43 +01:00
José Valim
af39afcdf8 More refactoring. 2010-03-03 12:03:43 +01:00
José Valim
1660831002 Give more flexibility when swapping controllers. 2010-03-03 12:03:42 +01:00
Carlos Antonio da Silva
03e11e4a18 We also have sign up as a valid path name for routes 2010-02-27 09:35:26 -03:00
José Valim
20ca0dc981 Add info about devise_facebook_connectable. 2010-02-27 09:13:42 +01:00
Daniel Kehoe
5c59f4cd1b Fixes to syntax, diction and spelling in README. 2010-02-27 16:04:38 +08:00
Daniel Kehoe
5bc741cdab Add a section 'Examples' to the README mentioning plataformatec/devise_example and fortuity/subdomain-authentication 2010-02-27 16:04:37 +08:00
Daniel Kehoe
cfb3305ae5 Add a section 'Related Applications' to the README with a mention of devise_invitable 2010-02-27 16:04:37 +08:00
Lucas Uyezu
8525b56318 SQLite requries a default value when the column is NOT NULL
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-02-25 08:33:38 +01:00
José Valim
bcb46bbccb Do not forget frozen records. 2010-02-25 08:00:10 +01:00
José Valim
484361e815 Improve error message on undefined method devise. 2010-02-25 07:54:06 +01:00
José Valim
94511c1a43 Bump to 1.1.pre3 2010-02-24 22:19:46 +01:00
Andrei Bocan
c914c143bc Fix typo in route description 2010-02-24 18:22:43 +08:00
José Valim
e03e137c35 Update warden which fixes a security issue. 2010-02-23 19:47:45 +01:00
snusnu
a12ca2955f Avoid datamapper deprecation warnings 2010-02-24 01:52:08 +08:00
José Valim
e6f3034b11 Do not remove options from MongoMapper and DataMapper in find. 2010-02-23 15:51:29 +01:00
José Valim
33cf55aa13 Add link to wiki on README. 2010-02-19 23:54:55 -07:00
José Valim
e9682a3e64 In Rails 3, for some reason, you need to restart the server after copying views. 2010-02-19 23:54:05 -07:00
Jacques Crocker
3f37ce03c8 Gemfile fix for mongomapper
Points MongoMapper dependency to use a fork on MongoMapper that supports Rails3.
2010-02-19 20:32:32 +08:00
Jacques Crocker
4a51394af5 MongoMapper test suite fixes 2010-02-19 20:32:31 +08:00
Carlos Antonio da Silva
b3283e097d Use available warden_options method instead of env. 2010-02-19 09:07:37 -02:00
Paul Campbell
e9c16d852e add paragraphs to html emails
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-02-19 10:20:02 +01:00
José Valim
1c6f18cb8b Since Devise::FailureApp is now a metal, we can get rid of this default_url_options stuff. 2010-02-19 10:13:53 +01:00
José Valim
4a0b9c663a Use metal for Devise::FailureApp. \m/ 2010-02-19 09:52:12 +01:00
José Valim
f0eb4348f3 Deprecate Devise.orm. This allows you to use several ORMs with Devise and reduces the required API. 2010-02-19 09:26:17 +01:00
José Valim
3ac399f2ff Returns the proper response body based on the rquest for 401. 2010-02-18 19:38:13 +01:00
José Valim
889803151d Release 1.1.pre2 2010-02-18 18:06:01 +01:00
José Valim
35e058b279 Fix the undefined method devise issue. 2010-02-18 18:04:08 +01:00
José Valim
104d5b0441 There is no such thing as magic, my dear Watson. 2010-02-18 17:59:05 +01:00
José Valim
968ebe1b15 Uses the same content type as request on http authenticatable 401 responses 2010-02-17 21:40:01 +01:00
José Valim
1282fc03cf Add missing autoload. 2010-02-17 16:53:17 +01:00
José Valim
a79e8e0404 Tiny change in generator README. 2010-02-17 16:37:27 +01:00
José Valim
6d6633d1fb Release 1.1.pre which is Rails 3 compatible. 2010-02-17 13:53:05 +01:00
José Valim
fdf06861b0 Load Devise ORM after initialization. 2010-02-17 13:18:08 +01:00
José Valim
f6cc219210 Devise now allows you to have custom controlleers. Check the README for more information. 2010-02-17 13:15:19 +01:00
José Valim
691f9324f5 Use ActiveSupport::Concern. 2010-02-17 12:35:38 +01:00
José Valim
8e21373946 Rename devise/shared/_devise_links to devise/shared/links. 2010-02-17 12:30:08 +01:00
José Valim
02e8c04cde Update views generator and now have scoped views. 2010-02-17 12:26:54 +01:00
José Valim
5bf2eb3850 Updated .gitignore. 2010-02-17 11:11:27 +01:00
José Valim
443a2d8343 Moved devise_install to rails 3 generators. 2010-02-17 11:10:24 +01:00
José Valim
38bfe3f990 First generator for Rails 3. 2010-02-17 11:00:10 +01:00
José Valim
b4bbd3b892 Get all tests passing for ActiveRecord and allow MongoMapper tests to run. 2010-02-17 10:11:43 +01:00
José Valim
33941d1f62 All tests passing (except two which are errors in Rails). Now generators and initialization process. 2010-02-16 21:23:58 +01:00
José Valim
e6e66481b8 Got all tests in test/models and failure app ones passing. 369 tests, 805 assertions, 13 failures, 2 errors. 2010-02-16 17:00:36 +01:00
José Valim
d466849c57 More tests passing for Rails 3 compatibility. 369 tests, 788 assertions, 34 failures, 16 errors. 2010-02-16 16:11:30 +01:00
José Valim
b3e11c5aca Got another bunch of tests passing on Rails 3. 369 tests, 731 assertions, 33 failures, 53 errors. 2010-02-16 14:57:10 +01:00
José Valim
766316b5e7 Got tests running on Rails 3: 369 tests, 486 assertions, 45 failures, 124 errors. 2010-02-16 14:31:49 +01:00
342 changed files with 17217 additions and 5530 deletions

View File

@@ -0,0 +1,25 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
{
"name": "Ruby",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/ruby:0-3-bullseye",
"features": {
"ghcr.io/devcontainers/features/github-cli:1": {}
},
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "bundle install",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

6
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"

63
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,63 @@
name: Test
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
gemfile:
- Gemfile
- gemfiles/Gemfile-rails-main
- gemfiles/Gemfile-rails-7-0
- gemfiles/Gemfile-rails-7-1
- gemfiles/Gemfile-rails-7-2
- gemfiles/Gemfile-rails-8-0
ruby:
- '4.0'
- '3.4'
- '3.3'
- '3.2'
- '3.1'
- '3.0'
- '2.7'
orm:
- active_record
- mongoid
exclude:
- gemfile: Gemfile
ruby: '3.1'
- gemfile: Gemfile
ruby: '3.0'
- gemfile: Gemfile
ruby: '2.7'
- gemfile: gemfiles/Gemfile-rails-main
ruby: '3.2'
- gemfile: gemfiles/Gemfile-rails-main
ruby: '3.1'
- gemfile: gemfiles/Gemfile-rails-main
ruby: '3.0'
- gemfile: gemfiles/Gemfile-rails-main
ruby: '2.7'
- gemfile: gemfiles/Gemfile-rails-8-0
ruby: '3.1'
- gemfile: gemfiles/Gemfile-rails-8-0
ruby: '3.0'
- gemfile: gemfiles/Gemfile-rails-8-0
ruby: '2.7'
- gemfile: gemfiles/Gemfile-rails-7-2
ruby: '3.0'
- gemfile: gemfiles/Gemfile-rails-7-2
ruby: '2.7'
runs-on: ubuntu-latest
env: # $BUNDLE_GEMFILE must be set at the job level, so it is set for all steps
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
DEVISE_ORM: ${{ matrix.orm }}
steps:
- uses: actions/checkout@v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true # runs bundle install and caches installed gems automatically
- uses: supercharge/mongodb-github-action@1.12.1
if: ${{ matrix.orm == 'mongoid' }}
- run: bundle exec rake

8
.gitignore vendored
View File

@@ -1,7 +1,11 @@
**/*/log/*
**/*/tmp/*
test/rails_app/log/*
test/rails_app/tmp/*
*~
coverage/*
*.sqlite3
.bundle
rdoc/*
pkg
log
test/tmp/*
gemfiles/*.lock

9
.yardopts Normal file
View File

@@ -0,0 +1,9 @@
--protected
--no-private
--embed-mixin ClassMethods
-
README.md
CHANGELOG.rdoc
CONTRIBUTING.md
MIT-LICENSE

62
CHANGELOG.md Normal file
View File

@@ -0,0 +1,62 @@
### 5.0.0.rc - 2025-12-31
* breaking changes
* Drop support to Ruby < 2.7
* Drop support to Rails < 7.0
* Remove deprecated `:bypass` option from `sign_in` helper, use `bypass_sign_in` instead. [#5803](https://github.com/heartcombo/devise/pull/5803)
* Remove deprecated `devise_error_messages!` helper, use `render "devise/shared/error_messages", resource: resource` instead. [#5803](https://github.com/heartcombo/devise/pull/5803)
* Remove deprecated `scope` second argument from `sign_in(resource, :admin)` controller test helper, use `sign_in(resource, scope: :admin)` instead. [#5803](https://github.com/heartcombo/devise/pull/5803)
* Remove deprecated `Devise::TestHelpers`, use `Devise::Test::ControllerHelpers` instead. [#5803](https://github.com/heartcombo/devise/pull/5803)
* Remove deprecated `Devise::Models::Authenticatable::BLACKLIST_FOR_SERIALIZATION` [#5598](https://github.com/heartcombo/devise/pull/5598)
* Remove deprecated `Devise.activerecord51?` method.
* Remove `SecretKeyFinder` and use `app.secret_key_base` as the default secret key for `Devise.secret_key` if a custom `Devise.secret_key` is not provided.
This is potentially a breaking change because Devise previously used the following order to find a secret key:
```
app.credentials.secret_key_base > app.secrets.secret_key_base > application.config.secret_key_base > application.secret_key_base
```
Now, it always uses `application.secret_key_base`. Make sure you're using the same secret key after the upgrade; otherwise, previously generated tokens for `recoverable`, `lockable`, and `confirmable` will be invalid.
[#5645](https://github.com/heartcombo/devise/pull/5645)
* Change password instructions button label on devise view from `Send me reset password instructions` to `Send me password reset instructions` [#5515](https://github.com/heartcombo/devise/pull/5515)
* Change `<br>` tags separating form elements to wrapping them in `<p>` tags [#5494](https://github.com/heartcombo/devise/pull/5494)
* Replace `[data-turbo-cache=false]` with `[data-turbo-temporary]` on `devise/shared/error_messages` partial. This has been [deprecated by Turbo since v7.3.0 (released on Mar 1, 2023)](https://github.com/hotwired/turbo/releases/tag/v7.3.0).
If you are using an older version of Turbo and the default devise template, you'll need to copy it over to your app and change that back to `[data-turbo-cache=false]`.
* enhancements
* Add Rails 8 support.
- Routes are lazy-loaded by default in test and development environments now so Devise loads them before `Devise.mappings` call. [#5728](https://github.com/heartcombo/devise/pull/5728)
* New apps using Rack 3.1+ will be generated using `config.responder.error_status = :unprocessable_content`, since [`:unprocessable_entity` has been deprecated by Rack](https://github.com/rack/rack/pull/2137).
Latest versions of [Rails transparently convert `:unprocessable_entity` -> `:unprocessable_content`](https://github.com/rails/rails/pull/53383), and Devise will use that in the failure app to avoid Rack deprecation warnings for apps that are configured with `:unprocessable_entity`. They can also simply change their `error_status` to `:unprocessable_content` in latest Rack versions to avoid the warning.
* Add Ruby 3.4 and 4.0 support.
* Reenable Mongoid test suite across all Rails 7+ versions, to ensure we continue supporting it. Changes to dirty tracking to support Mongoid 8.0+. [#5568](https://github.com/heartcombo/devise/pull/5568)
* Password length validator is changed from
```
validates_length_of :password, within: password_length, allow_blank: true`
```
to
```
validates_length_of :password, minimum: proc { password_length.min }, maximum: proc { password_length.max }, allow_blank: true
```
so it's possible to override `password_length` at runtime. [#5734](https://github.com/heartcombo/devise/pull/5734)
* bug fixes
* Make `Devise` work without `ActionMailer` when `Zeitwerk` autoloader is used. [#5731](https://github.com/heartcombo/devise/pull/5731)
* Handle defaults `:from` and `:reply_to` as procs correctly by delegating to Rails [#5595](https://github.com/heartcombo/devise/pull/5595)
* Use `OmniAuth.config.allowed_request_methods` as routing verbs for the auth path [#5508](https://github.com/heartcombo/devise/pull/5508)
* Handle `on` and `ON` as true values to check params [#5514](https://github.com/heartcombo/devise/pull/5514)
* Fix passing `format` option to `devise_for` [#5732](https://github.com/heartcombo/devise/pull/5732)
* Use `ActiveRecord::SecurityUtils.secure_compare` in `Devise.secure_compare` to match two empty strings correctly. [#4829](https://github.com/heartcombo/devise/pull/4829)
* Respond with `401 Unauthorized` for non-navigational requests to destroy the session when there is no authenticated resource. [#4878](https://github.com/heartcombo/devise/pull/4878)
* Fix incorrect grammar of invalid authentication message with capitalized attributes, e.g.: "Invalid Email or password" => "Invalid email or password". (originally introduced by [#4014](https://github.com/heartcombo/devise/pull/4014), released on v4.1.0) [#4834](https://github.com/heartcombo/devise/pull/4834)
Please check [4-stable](https://github.com/heartcombo/devise/blob/4-stable/CHANGELOG.md)
for previous changes.

View File

@@ -1,333 +0,0 @@
== 1.0.1
* enhancements
* HttpAuthenticatable is not added by default automatically.
* Avoid mass assignment error messages with current password.
* bug fix
* Fixed encryptors autoload
== 1.0.0
* deprecation
* :old_password in update_with_password is deprecated, use :current_password instead
* enhancements
* Added Registerable
* Added Http Basic Authentication support
* Allow scoped_views to be customized per controller/mailer class
* [#99] Allow authenticatable to used in change_table statements
== 0.9.2
* bug fix
* Ensure inactive user cannot sign in
* Ensure redirect to proper url after sign up
* enhancements
* Added gemspec to repo
* Added token authenticatable (by github.com/grimen)
== 0.9.1
* bug fix
* Allow bigger salt size (by github.com/jgeiger)
* Fix relative url root
== 0.9.0
* deprecation
* devise :all is deprecated
* :success and :failure flash messages are now :notice and :alert
* enhancements
* Added devise lockable (by github.com/mhfs)
* Warden 0.9.0 compatibility
* Mongomapper 0.6.10 compatibility
* Added Devise.add_module as hooks for extensions (by github.com/grimen)
* Ruby 1.9.1 compatibility (by github.com/grimen)
* bug fix
* Accept path prefix not starting with slash
* url helpers should rely on find_scope!
== 0.8.2
* enhancements
* Allow Devise.mailer_sender to be a proc (by github.com/grimen)
* bug fix
* Fix bug with passenger, update is required to anyone deploying on passenger (by github.com/dvdpalm)
== 0.8.1
* enhancements
* Move salt to encryptors
* Devise::Lockable
* Moved view links into partial and I18n'ed them
* bug fix
* Bcrypt generator was not being loaded neither setting the proper salt
== 0.8.0
* enhancements
* Warden 0.8.0 compatibility
* Add an easy for map.connect "sign_in", :controller => "sessions", :action => "new" to work
* Added :bcrypt encryptor (by github.com/capotej)
* bug fix
* sign_in_count is also increased when user signs in via password change, confirmation, etc..
* More DataMapper compatibility (by github.com/lancecarlson)
* deprecation
* Removed DeviseMailer.sender
== 0.7.5
* enhancements
* Set a default value for mailer to avoid find_template issues
* Add models configuration to MongoMapper::EmbeddedDocument as well
== 0.7.4
* enhancements
* Extract Activatable from Confirmable
* Decouple Serializers from Devise modules
== 0.7.3
* bug fix
* Give scope to the proper model validation
* enhancements
* Mail views are scoped as well
* Added update_with_password for authenticatable
* Allow render_with_scope to accept :controller option
== 0.7.2
* deprecation
* Renamed reset_confirmation! to resend_confirmation!
* Copying locale is part of the installation process
* bug fix
* Fixed render_with_scope to work with all controllers
* Allow sign in with two different users in Devise::TestHelpers
== 0.7.1
* enhancements
* Small enhancements for other plugins compatibility (by github.com/grimen)
== 0.7.0
* deprecations
* :authenticatable is not included by default anymore
* enhancements
* Improve loading process
* Extract SessionSerializer from Authenticatable
== 0.6.3
* bug fix
* Added trackable to migrations
* Allow inflections to work
== 0.6.2
* enhancements
* More DataMapper compatibility
* Devise::Trackable - track sign in count, timestamps and ips
== 0.6.1
* enhancements
* Devise::Timeoutable - timeout sessions without activity
* DataMapper now accepts conditions
== 0.6.0
* deprecations
* :authenticatable is still included by default, but yields a deprecation warning
* enhancements
* Added DataMapper support
* Remove store_location from authenticatable strategy and add it to failure app
* Allow a strategy to be placed after authenticatable
* [#45] Do not rely attribute? methods, since they are not added on Datamapper
== 0.5.6
* enhancements
* [#42] Do not send nil to build (DataMapper compatibility)
* [#44] Allow to have scoped views
== 0.5.5
* enhancements
* Allow overwriting find for authentication method
* [#38] Remove Ruby 1.8.7 dependency
== 0.5.4
* deprecations
* Deprecate :singular in devise_for and use :scope instead
* enhancements
* [#37] Create after_sign_in_path_for and after_sign_out_path_for hooks to be
overwriten in ApplicationController
* Create sign_in_and_redirect and sign_out_and_redirect helpers
* Warden::Manager.default_scope is automatically configured to the first given scope
== 0.5.3
* bug fix
* MongoMapper now converts DateTime to Time
* Ensure all controllers are unloadable
* enhancements
* [#35] Moved friendly_token to Devise
* Added Devise.all, so you can freeze your app strategies
* Added Devise.apply_schema, so you can turn it to false in Datamapper or MongoMapper
in cases you don't want it be handlded automatically
== 0.5.2
* enhancements
* [#28] Improved sign_in and sign_out helpers to accepts resources
* [#28] Added stored_location_for as a helper
* [#20] Added test helpers
== 0.5.1
* enhancements
* Added serializers based on Warden ones
* Allow authentication keys to be set
== 0.5.0
* bug fix
* Fixed a bug where remember me module was not working properly
* enhancements
* Moved encryption strategy into the Encryptors module to allow several algorithms (by github.com/mhfs)
* Implemented encryptors for Clearance, Authlogic and Restful-Authentication (by github.com/mhfs)
* Added support for MongoMapper (by github.com/shingara)
== 0.4.3
* bug fix
* [#29] Authentication just fails if user cannot be serialized from session, without raising errors;
* Default configuration values should not overwrite user values;
== 0.4.2
* deprecations
* Renamed mail_sender to mailer_sender
* enhancements
* skip_before_filter added in Devise controllers
* Use home_or_root_path on require_no_authentication as well
* Added devise_controller?, useful to select or reject filters in ApplicationController
* Allow :path_prefix to be given to devise_for
* Allow default_url_options to be configured through devise (:path_prefix => "/:locale" is now supported)
== 0.4.1
* bug fix
* [#21] Ensure options can be set even if models were not loaded
== 0.4.0
* deprecations
* Notifier is deprecated, use DeviseMailer instead. Remember to rename
app/views/notifier to app/views/devise_mailer and I18n key from
devise.notifier to devise.mailer
* :authenticable calls are deprecated, use :authenticatable instead
* enhancements
* [#16] Allow devise to be more agnostic and do not require ActiveRecord to be loaded
* Allow Warden::Manager to be configured through Devise
* Created a generator which creates an initializer
== 0.3.0
* bug fix
* [#15] Allow yml messages to be configured by not using engine locales
* deprecations
* Renamed confirm_in to confirm_within
* [#14] Do not send confirmation messages when user changes his e-mail
* [#13] Renamed authenticable to authenticatable and added deprecation warnings
== 0.2.3
* enhancements
* Ensure fail! works inside strategies
* [#12] Make unauthenticated message (when you haven't signed in) different from invalid message
* bug fix
* Do not redirect on invalid authenticate
* Allow model configuration to be set to nil
== 0.2.2
* bug fix
* [#9] Fix a bug when using customized resources
== 0.2.1
* refactor
* Clean devise_views generator to use devise existing views
* enhancements
* [#7] Create instance variables (like @user) for each devise controller
* Use Devise::Controller::Helpers only internally
* bug fix
* [#6] Fix a bug with Mongrel and Ruby 1.8.6
== 0.2.0
* enhancements
* [#4] Allow option :null => true in authenticable migration
* [#3] Remove attr_accessible calls from devise modules
* Customizable time frame for rememberable with :remember_for config
* Customizable time frame for confirmable with :confirm_in config
* Generators for creating a resource and copy views
* optimize
* Do not load hooks or strategies if they are not used
* bug fixes
* [#2] Fixed requiring devise strategies
== 0.1.1
* bug fixes
* [#1] Fixed requiring devise mapping
== 0.1.0
* Devise::Authenticable
* Devise::Confirmable
* Devise::Recoverable
* Devise::Validatable
* Devise::Migratable
* Devise::Rememberable
* SessionsController
* PasswordsController
* ConfirmationsController
* Create an example app
* devise :all, :except => :rememberable
* Use sign_in and sign_out in SessionsController
* Mailer subjects namespaced by model
* Allow stretches and pepper per model
* Store session[:return_to] in session
* Sign user in automatically after confirming or changing it's password

22
CODE_OF_CONDUCT.md Normal file
View File

@@ -0,0 +1,22 @@
# Contributor Code of Conduct
As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery
* Personal attacks
* Trolling or insulting/derogatory comments
* Public or private harassment
* Publishing other's private information, such as physical or electronic addresses, without explicit permission
* Other unethical or unprofessional conduct.
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.
This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by sending an email to [heartcombo.oss@gmail.com](heartcombo.oss@gmail.com) or contacting one or more of the project maintainers.
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/)

79
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,79 @@
# How to contribute to Devise
Thanks for your interest on contributing to Devise! Here are a few general
guidelines on contributing and reporting bugs to Devise that we ask you to
take a look first. Notice that all of your interactions in the project are
expected to follow our [Code of Conduct](CODE_OF_CONDUCT.md).
## Reporting Issues
Before reporting a new issue, please be sure that the issue wasn't already
reported or fixed by searching on GitHub through our [issues](https://github.com/heartcombo/devise/issues).
When creating a new issue, be sure to include a **title and clear description**,
as much relevant information as possible, and either a test case example or
even better a **sample Rails app that replicates the issue** - Devise has a lot
of moving parts and it's functionality can be affected by third party gems, so
we need as much context and details as possible to identify what might be broken
for you. We have a [test case template](guides/bug_report_templates/integration_test.rb)
that can be used to replicate issues with minimal setup.
Please do not attempt to translate Devise built in views. The views are meant
to be a starting point for fresh apps and not production material - eventually
all applications will require custom views where you can write your own copy and
translate it if the application requires it . For historical references, please look into closed
[Issues/Pull Requests](https://github.com/heartcombo/devise/issues?q=i18n) regarding
internationalization.
Avoid opening new issues to ask questions in our issues tracker. Please go through
the project wiki, documentation and source code first, or try to ask your question
on [Stack Overflow](http://stackoverflow.com/questions/tagged/devise).
**If you find a security bug, do not report it through GitHub. Please send an
e-mail to [heartcombo.oss@gmail.com](mailto:heartcombo.oss@gmail.com)
instead.**
## Sending Pull Requests
Before sending a new Pull Request, take a look on existing Pull Requests and Issues
to see if the proposed change or fix has been discussed in the past, or if the
change was already implemented but not yet released.
We expect new Pull Requests to include enough tests for new or changed behavior,
and we aim to maintain everything as most backwards compatible as possible,
reserving breaking changes to be ship in major releases when necessary - you
can wrap the new code path with a setting toggle from the `Devise` module defined
as `false` by default to require developers to opt-in for the new behavior.
If your Pull Request includes new or changed behavior, be sure that the changes
are beneficial to a wide range of use cases or it's an application specific change
that might not be so valuable to other applications. Some changes can be introduced
as a new `devise-something` gem instead of belonging to the main codebase.
When adding new settings, you can take advantage of the [`Devise::Models.config`](https://github.com/heartcombo/devise/blob/245b1f9de0b3386b7913e14b60ea24f43b77feb0/lib/devise/models.rb#L13-L50) method to add class and instance level fallbacks
to the new setting.
We also welcome Pull Requests that improve our existing documentation (both our
`README.md` and the RDoc sections in the source code) or improve existing rough
edges in our API that might be blocking existing integrations or 3rd party gems.
## Other ways to contribute
We welcome anyone that wants to contribute to Devise to triage and reply to
open issues to help troubleshoot and fix existing bugs on Devise. Here is what
you can do:
* Help ensure that existing issues follows the recommendations from the
_[Reporting Issues](#reporting-issues)_ section, providing feedback to the issue's
author on what might be missing.
* Review and update the existing content of our [Wiki](https://github.com/heartcombo/devise/wiki)
with up to date instructions and code samples - the wiki was grown with several
different tutorials and references that we can't keep track of everything, so if
there is a page that showcases an integration or customization that you are
familiar with feel free to update it as necessary.
* Review existing Pull Requests, and testing patches against real existing
applications that use Devise.
Thanks again for your interest on contributing to the project!
:heart:

33
Gemfile Normal file
View File

@@ -0,0 +1,33 @@
# frozen_string_literal: true
source "https://rubygems.org"
gemspec
gem "omniauth"
gem "omniauth-oauth2"
gem "rails", "~> 8.1.0"
gem "rdoc"
gem "rails-controller-testing"
gem "responders", "~> 3.1"
group :test do
gem "minitest", "< 6"
gem "mocha", "~> 2.1", require: false
gem "omniauth-facebook"
gem "omniauth-openid"
gem "rexml"
gem "timecop"
gem "webrat"
gem "ostruct"
end
platforms :ruby do
gem "sqlite3"
end
group :mongoid do
gem "mongoid", "~> 9.0", github: "mongodb/mongoid", branch: "9.0-stable"
end

312
Gemfile.lock Normal file
View File

@@ -0,0 +1,312 @@
GIT
remote: https://github.com/mongodb/mongoid.git
revision: 4dcdaddea5d88a819c7c0d98ea0e994e13f515fe
branch: 9.0-stable
specs:
mongoid (9.0.9)
activemodel (>= 5.1, < 8.2, != 7.0.0)
concurrent-ruby (>= 1.0.5, < 2.0)
mongo (>= 2.18.0, < 3.0.0)
PATH
remote: .
specs:
devise (5.0.0.rc)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 7.0)
responders
warden (~> 1.2.3)
GEM
remote: https://rubygems.org/
specs:
action_text-trix (2.1.15)
railties
actioncable (8.1.1)
actionpack (= 8.1.1)
activesupport (= 8.1.1)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (8.1.1)
actionpack (= 8.1.1)
activejob (= 8.1.1)
activerecord (= 8.1.1)
activestorage (= 8.1.1)
activesupport (= 8.1.1)
mail (>= 2.8.0)
actionmailer (8.1.1)
actionpack (= 8.1.1)
actionview (= 8.1.1)
activejob (= 8.1.1)
activesupport (= 8.1.1)
mail (>= 2.8.0)
rails-dom-testing (~> 2.2)
actionpack (8.1.1)
actionview (= 8.1.1)
activesupport (= 8.1.1)
nokogiri (>= 1.8.5)
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
useragent (~> 0.16)
actiontext (8.1.1)
action_text-trix (~> 2.1.15)
actionpack (= 8.1.1)
activerecord (= 8.1.1)
activestorage (= 8.1.1)
activesupport (= 8.1.1)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (8.1.1)
activesupport (= 8.1.1)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (8.1.1)
activesupport (= 8.1.1)
globalid (>= 0.3.6)
activemodel (8.1.1)
activesupport (= 8.1.1)
activerecord (8.1.1)
activemodel (= 8.1.1)
activesupport (= 8.1.1)
timeout (>= 0.4.0)
activestorage (8.1.1)
actionpack (= 8.1.1)
activejob (= 8.1.1)
activerecord (= 8.1.1)
activesupport (= 8.1.1)
marcel (~> 1.0)
activesupport (8.1.1)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
json
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
base64 (0.3.0)
bcrypt (3.1.20)
bigdecimal (4.0.1)
bson (5.2.0)
builder (3.3.0)
concurrent-ruby (1.3.6)
connection_pool (3.0.2)
crass (1.0.6)
date (3.5.1)
drb (2.2.3)
erb (6.0.1)
erubi (1.13.1)
faraday (2.14.0)
faraday-net_http (>= 2.0, < 3.5)
json
logger
faraday-net_http (3.4.2)
net-http (~> 0.5)
globalid (1.3.0)
activesupport (>= 6.1)
hashie (5.1.0)
logger
i18n (1.14.8)
concurrent-ruby (~> 1.0)
io-console (0.8.2)
irb (1.16.0)
pp (>= 0.6.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.18.0)
jwt (3.1.2)
base64
logger (1.7.0)
loofah (2.25.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.9.0)
logger
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.1.0)
mini_mime (1.1.5)
mini_portile2 (2.8.9)
minitest (5.27.0)
mocha (2.8.2)
ruby2_keywords (>= 0.0.5)
mongo (2.22.0)
base64
bson (>= 4.14.1, < 6.0.0)
multi_xml (0.8.0)
bigdecimal (>= 3.1, < 5)
net-http (0.9.1)
uri (>= 0.11.1)
net-imap (0.6.2)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.5.1)
net-protocol
nio4r (2.7.5)
nokogiri (1.19.0)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
oauth2 (2.0.18)
faraday (>= 0.17.3, < 4.0)
jwt (>= 1.0, < 4.0)
logger (~> 1.2)
multi_xml (~> 0.5)
rack (>= 1.2, < 4)
snaky_hash (~> 2.0, >= 2.0.3)
version_gem (~> 1.1, >= 1.1.9)
omniauth (2.1.4)
hashie (>= 3.4.6)
logger
rack (>= 2.2.3)
rack-protection
omniauth-facebook (10.0.0)
bigdecimal
omniauth-oauth2 (>= 1.2, < 3)
omniauth-oauth2 (1.9.0)
oauth2 (>= 2.0.2, < 3)
omniauth (~> 2.0)
omniauth-openid (2.0.2)
omniauth (>= 1.1)
rack-openid (~> 1.4)
ruby-openid (~> 2.1, >= 2.1.8)
version_gem (~> 1.1, >= 1.1.8)
orm_adapter (0.5.0)
ostruct (0.6.3)
pp (0.6.3)
prettyprint
prettyprint (0.2.0)
psych (5.3.1)
date
stringio
racc (1.8.1)
rack (3.2.4)
rack-openid (1.4.2)
rack (>= 1.1.0)
ruby-openid (>= 2.1.8)
rack-protection (4.2.1)
base64 (>= 0.1.0)
logger (>= 1.6.0)
rack (>= 3.0.0, < 4)
rack-session (2.1.1)
base64 (>= 0.1.0)
rack (>= 3.0.0)
rack-test (2.2.0)
rack (>= 1.3)
rackup (2.3.1)
rack (>= 3)
rails (8.1.1)
actioncable (= 8.1.1)
actionmailbox (= 8.1.1)
actionmailer (= 8.1.1)
actionpack (= 8.1.1)
actiontext (= 8.1.1)
actionview (= 8.1.1)
activejob (= 8.1.1)
activemodel (= 8.1.1)
activerecord (= 8.1.1)
activestorage (= 8.1.1)
activesupport (= 8.1.1)
bundler (>= 1.15.0)
railties (= 8.1.1)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
actionview (>= 5.0.1.rc1)
activesupport (>= 5.0.1.rc1)
rails-dom-testing (2.3.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.2)
loofah (~> 2.21)
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
railties (8.1.1)
actionpack (= 8.1.1)
activesupport (= 8.1.1)
irb (~> 1.13)
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
tsort (>= 0.2)
zeitwerk (~> 2.6)
rake (13.3.1)
rdoc (7.0.3)
erb
psych (>= 4.0.0)
tsort
reline (0.6.3)
io-console (~> 0.5)
responders (3.2.0)
actionpack (>= 7.0)
railties (>= 7.0)
rexml (3.4.4)
ruby-openid (2.9.2)
ruby2_keywords (0.0.5)
securerandom (0.4.1)
snaky_hash (2.0.3)
hashie (>= 0.1.0, < 6)
version_gem (>= 1.1.8, < 3)
sqlite3 (2.9.0)
mini_portile2 (~> 2.8.0)
stringio (3.2.0)
thor (1.4.0)
timecop (0.9.10)
timeout (0.6.0)
tsort (0.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uri (1.1.1)
useragent (0.16.11)
version_gem (1.1.9)
warden (1.2.9)
rack (>= 2.0.9)
webrat (0.7.3)
nokogiri (>= 1.2.0)
rack (>= 1.0)
rack-test (>= 0.5.3)
websocket-driver (0.8.0)
base64
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
zeitwerk (2.7.4)
PLATFORMS
ruby
DEPENDENCIES
devise!
minitest (< 6)
mocha (~> 2.1)
mongoid (~> 9.0)!
omniauth
omniauth-facebook
omniauth-oauth2
omniauth-openid
ostruct
rails (~> 8.1.0)
rails-controller-testing
rdoc
responders (~> 3.1)
rexml
sqlite3
timecop
webrat
BUNDLED WITH
4.0.3

20
ISSUE_TEMPLATE.md Normal file
View File

@@ -0,0 +1,20 @@
## Pre-check
- Do not use the issues tracker for help or support, try Stack Overflow.
- For bugs, do a quick search and make sure the bug has not yet been reported
- If you found a security bug, do not report it through GitHub. Please send an e-mail to heartcombo.oss@gmail.com instead.
- Finally, be nice and have fun!
## Environment
- Ruby **[version]**
- Rails **[version]**
- Devise **[version]**
## Current behavior
Include code samples, errors, steps to reproduce the error and stack traces if appropriate.
Will be even more helpful if you provide a sample application or a test case that reproduces the error.
## Expected behavior

View File

@@ -1,4 +1,5 @@
Copyright 2009 Plataforma Tecnologia. http://blog.plataformatec.com.br
Copyright (c) 2020-CURRENT Rafael França, Carlos Antonio da Silva
Copyright (c) 2009-2019 Plataformatec
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the

776
README.md Normal file
View File

@@ -0,0 +1,776 @@
![Devise Logo](https://raw.github.com/heartcombo/devise/main/devise.png)
Devise is a flexible authentication solution for Rails based on Warden. It:
* Is Rack based;
* Is a complete MVC solution based on Rails engines;
* Allows you to have multiple models signed in at the same time;
* Is based on a modularity concept: use only what you really need.
It's composed of 10 modules:
* [Database Authenticatable](https://www.rubydoc.info/gems/devise/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](https://www.rubydoc.info/gems/devise/Devise/Models/Omniauthable): adds OmniAuth (https://github.com/omniauth/omniauth) support.
* [Confirmable](https://www.rubydoc.info/gems/devise/Devise/Models/Confirmable): sends emails with confirmation instructions and verifies whether an account is already confirmed during sign in.
* [Recoverable](https://www.rubydoc.info/gems/devise/Devise/Models/Recoverable): resets the user password and sends reset instructions.
* [Registerable](https://www.rubydoc.info/gems/devise/Devise/Models/Registerable): handles signing up users through a registration process, also allowing them to edit and destroy their account.
* [Rememberable](https://www.rubydoc.info/gems/devise/Devise/Models/Rememberable): manages generating and clearing a token for remembering the user from a saved cookie.
* [Trackable](https://www.rubydoc.info/gems/devise/Devise/Models/Trackable): tracks sign in count, timestamps and IP address.
* [Timeoutable](https://www.rubydoc.info/gems/devise/Devise/Models/Timeoutable): expires sessions that have not been active in a specified period of time.
* [Validatable](https://www.rubydoc.info/gems/devise/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](https://www.rubydoc.info/gems/devise/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
<!-- TOC depthFrom:1 depthTo:6 withLinks:1 orderedList:0 -->
- [Information](#information)
- [The Devise wiki](#the-devise-wiki)
- [Bug reports](#bug-reports)
- [StackOverflow and Mailing List](#stackoverflow-and-mailing-list)
- [RDocs](#rdocs)
- [Example applications](#example-applications)
- [Extensions](#extensions)
- [Supported Ruby / Rails versions](#supported-ruby--rails-versions)
- [Contributing](#contributing)
- [Starting with Rails?](#starting-with-rails)
- [Getting started](#getting-started)
- [Controller filters and helpers](#controller-filters-and-helpers)
- [Configuring Models](#configuring-models)
- [Strong Parameters](#strong-parameters)
- [Configuring views](#configuring-views)
- [Configuring controllers](#configuring-controllers)
- [Configuring routes](#configuring-routes)
- [I18n](#i18n)
- [Test helpers](#test-helpers)
- [Controller tests](#controller-tests)
- [Integration tests](#integration-tests)
- [OmniAuth](#omniauth)
- [Configuring multiple models](#configuring-multiple-models)
- [Active Job Integration](#active-job-integration)
- [Password reset tokens and Rails logs](#password-reset-tokens-and-rails-logs)
- [Other ORMs](#other-orms)
- [Rails API mode](#rails-api-mode)
- [Additional information](#additional-information)
- [Warden](#warden)
- [License](#license)
<!-- /TOC -->
## Information
### The Devise wiki
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/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/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 heartcombo.oss@gmail.com.
### StackOverflow and Mailing List
If you have any questions, comments, or concerns, please use StackOverflow instead of the GitHub issue tracker:
http://stackoverflow.com/questions/tagged/devise
The deprecated mailing lists can still be read on:
https://groups.google.com/group/plataformatec-devise
https://groups.google.com/group/heartcombo
### RDocs
You can view the Devise documentation in RDoc format here:
http://rubydoc.info/github/heartcombo/devise/main/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.
### Example applications
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/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/heartcombo/devise/wiki/Extensions
### Supported Ruby / Rails versions
We intend to maintain support for all Ruby / Rails versions that haven't reached end-of-life.
For more information about specific versions please check [Ruby](https://www.ruby-lang.org/en/downloads/branches/)
and [Rails](https://guides.rubyonrails.org/maintenance_policy.html) maintenance policies, and our test matrix.
### 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/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 supports 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`:
```
DEVISE_ORM=mongoid bin/test
==> Devise.orm = :mongoid
```
When running the tests for Mongoid, you will need to have a MongoDB server (version 2.0 or newer) running on your system.
Please note that the command output will show the variable value being used.
#### 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/heartcombo/devise/tree/main/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 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 3.4 and Rails 8.0, you can do the following:
```bash
chruby 3.4.0 # or rbenv shell 3.4.0, or rvm use 3.4.0, etc.
BUNDLE_GEMFILE=gemfiles/Gemfile-rails-8-0 bundle install
BUNDLE_GEMFILE=gemfiles/Gemfile-rails-8-0 bin/test
```
You can also combine both of them if the tests broke for Mongoid:
```bash
BUNDLE_GEMFILE=gemfiles/Gemfile-rails-8-0 bundle install
BUNDLE_GEMFILE=gemfiles/Gemfile-rails-8-0 DEVISE_ORM=mongoid bin/test
```
### Running tests
Devise uses [Mini Test](https://github.com/seattlerb/minitest) as test framework.
* Running all tests:
```bash
bin/test
```
* Running tests for an specific file:
```bash
bin/test test/models/trackable_test.rb
```
* Running a specific test given a line number or a regex:
```bash
bin/test test/models/trackable_test.rb:16
bin/test test/models/trackable_test.rb -n '/update.*record/'
```
## 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. 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' 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:
## Getting started
Devise 5 works with Rails 7 onwards. Run:
```sh
bundle add devise
```
Next, you need to run the generator:
```console
rails generate devise:install
```
At this point, a number of instructions will appear in the console. Among these instructions, you'll need to set up the default URL options for the Devise mailer in each environment. Here is a possible configuration for `config/environments/development.rb`:
```ruby
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
```
The generator will install an initializer which describes ALL of Devise's configuration options. It is *imperative* that you take a look at it. When you are done, you are ready to add Devise to any of your models using the generator.
In the following command you will replace `MODEL` with the class name used for the applications users (its frequently `User` but could also be `Admin`). This will create a model (if one does not exist) and configure it with the default Devise modules. The generator also configures your `config/routes.rb` file to point to the Devise controller.
```console
rails generate devise MODEL
```
Next, check the MODEL for any additional configuration options you might want to add, such as confirmable or lockable. If you add an option, be sure to inspect the migration file (created by the generator if your ORM supports them) and uncomment the appropriate section. For example, if you add the confirmable option in the model, you'll need to uncomment the Confirmable section in the migration.
Then run `rails db:migrate`
You should restart your application after changing Devise's configuration options (this includes stopping spring). Otherwise, you will run into strange errors, for example, users being unable to login and route helpers being undefined.
### Controller filters and helpers
Devise will create some helpers to use inside your controllers and views. To set up a controller with user authentication, just add this before_action (assuming your devise model is 'User'):
```ruby
before_action :authenticate_user!
```
For Rails 5, note that `protect_from_forgery` is no longer prepended to the `before_action` chain, so if you have set `authenticate_user` before `protect_from_forgery`, your request will result in "Can't verify CSRF token authenticity." To resolve this, either change the order in which you call them, or use `protect_from_forgery prepend: true`.
If your devise model is something other than User, replace "_user" with "_yourmodel". The same logic applies to the instructions below.
To verify if a user is signed in, use the following helper:
```ruby
user_signed_in?
```
For the current signed-in user, this helper is available:
```ruby
current_user
```
You can access the session for this scope:
```ruby
user_session
```
After signing in a user, confirming the account or updating the password, Devise will look for a scoped root path to redirect to. For instance, when using a `:user` resource, the `user_root_path` will be used if it exists; otherwise, the default `root_path` will be used. This means that you need to set the root inside your routes:
```ruby
root to: 'home#index'
```
You can also override `after_sign_in_path_for` and `after_sign_out_path_for` to customize your redirect hooks.
Notice that if your Devise model is called `Member` instead of `User`, for example, then the helpers available are:
```ruby
before_action :authenticate_member!
member_signed_in?
current_member
member_session
```
### Configuring Models
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: 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/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.
There are just three actions in Devise that allow any set of parameters to be passed down to the model, therefore requiring sanitization. Their names and default permitted parameters are:
* `sign_in` (`Devise::SessionsController#create`) - Permits only the authentication keys (like `email`)
* `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 action in your `ApplicationController`:
```ruby
class ApplicationController < ActionController::Base
before_action :configure_permitted_parameters, if: :devise_controller?
protected
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:username])
end
end
```
The above works for any additional fields where the parameters are simple scalar types. If you have nested attributes (say you're using `accepts_nested_attributes_for`), then you will need to tell devise about those nestings and types:
```ruby
class ApplicationController < ActionController::Base
before_action :configure_permitted_parameters, if: :devise_controller?
protected
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, address_attributes: [:country, :state, :city, :area, :postal_code]])
end
end
```
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
```ruby
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_in) do |user_params|
user_params.permit(:username, :email)
end
end
```
If you have some checkboxes that express the roles a user may take on registration, the browser will send those selected checkboxes as an array. An array is not one of Strong Parameters' permitted scalars, so we need to configure Devise in the following way:
```ruby
def configure_permitted_parameters
devise_parameter_sanitizer.permit(:sign_up) do |user_params|
user_params.permit({ roles: [] }, :email, :password, :password_confirmation)
end
end
```
For the list of permitted scalars, and how to declare permitted keys in nested hashes and arrays, see
https://github.com/rails/strong_parameters#nested-parameters
If you have multiple Devise models, you may want to set up a different parameter sanitizer per model. In this case, we recommend inheriting from `Devise::ParameterSanitizer` and adding your own logic:
```ruby
class User::ParameterSanitizer < Devise::ParameterSanitizer
def initialize(*)
super
permit(:sign_up, keys: [:username, :email])
end
end
```
And then configure your controllers to use it:
```ruby
class ApplicationController < ActionController::Base
protected
def devise_parameter_sanitizer
if resource_class == User
User::ParameterSanitizer.new(User, :user, params)
else
super # Use the default one
end
end
end
```
The example above overrides the permitted parameters for the user to be both `:username` and `:email`. The non-lazy way to configure parameters would be by defining the before filter above in a custom controller. We detail how to configure and customize controllers in some sections below.
### Configuring views
We built Devise to help you quickly develop an application that uses authentication. However, we don't want to be in your way when you need to customize it.
Since Devise is an engine, all its views are packaged inside the gem. These views will help you get started, but after some time you may want to change them. If this is the case, you just need to invoke the following generator, and it will copy all views to your application:
```console
rails generate devise:views
```
If you have more than one Devise model in your application (such as `User` and `Admin`), you will notice that Devise uses the same views for all models. Fortunately, Devise offers an easy way to customize views. All you need to do is set `config.scoped_views = true` inside the `config/initializers/devise.rb` file.
After doing so, you will be able to have views based on the role like `users/sessions/new` and `admins/sessions/new`. If no view is found within the scope, Devise will use the default view at `devise/sessions/new`. You can also use the generator to generate scoped views:
```console
rails generate devise:views users
```
If you would like to generate only a few sets of views, like the ones for the `registerable` and `confirmable` module,
you can pass a list of views to the generator with the `-v` flag.
```console
rails generate devise:views -v registrations confirmations
```
### Configuring controllers
If the customization at the views level is not enough, you can customize each controller by following these steps:
1. Create your custom controllers using the generator which requires a scope:
```console
rails generate devise:controllers [scope]
```
If you specify `users` as the scope, controllers will be created in `app/controllers/users/`.
And the sessions controller will look like this:
```ruby
class Users::SessionsController < Devise::SessionsController
# GET /resource/sign_in
# def new
# super
# end
...
end
```
Use the `-c` flag to specify one or more controllers, for example: `rails generate devise:controllers users -c sessions`
2. Tell the router to use this controller:
```ruby
devise_for :users, controllers: { sessions: 'users/sessions' }
```
3. Recommended but not required: copy (or move) the views from `devise/sessions` to `users/sessions`. Rails will continue using the views from `devise/sessions` due to inheritance if you skip this step, but having the views matching the controller(s) keeps things consistent.
4. Finally, change or extend the desired controller actions.
You can completely override a controller action:
```ruby
class Users::SessionsController < Devise::SessionsController
def create
# custom sign-in code
end
end
```
Or you can simply add new behavior to it:
```ruby
class Users::SessionsController < Devise::SessionsController
def create
super do |resource|
BackgroundWorker.trigger(resource)
end
end
end
```
This is useful for triggering background jobs or logging events during certain actions.
Remember that Devise uses flash messages to let users know if sign in was successful or unsuccessful. Devise expects your application to call `flash[:notice]` and `flash[:alert]` as appropriate. Do not print the entire flash hash, print only specific keys. In some circumstances, Devise adds a `:timedout` key to the flash hash, which is not meant for display. Remove this key from the hash if you intend to print the entire hash.
### Configuring routes
Devise also ships with default routes. If you need to customize them, you should probably be able to do it through the devise_for method. It accepts several options like :class_name, :path_prefix and so on, including the possibility to change path names for I18n:
```ruby
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](https://www.rubydoc.info/gems/devise/ActionDispatch/Routing/Mapper#devise_for-instance_method) 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:
```ruby
devise_scope :user do
get 'sign_in', to: 'devise/sessions#new'
end
```
This way, you tell Devise to use the scope `:user` when "/sign_in" is accessed. Notice `devise_scope` is also aliased as `as` in your router.
Please note: You will still need to add `devise_for` in your routes in order to use helper methods such as `current_user`.
```ruby
devise_for :users, skip: :all
```
### Hotwire/Turbo
Devise integrates with Hotwire/Turbo by treating such requests as navigational, and configuring certain responses for errors and redirects to match the expected behavior. New apps are generated with the following response configuration by default, and existing apps may opt-in by adding the config to their Devise initializers:
```ruby
Devise.setup do |config|
# ...
# When using Devise with Hotwire/Turbo, the http status for error responses
# and some redirects must match the following. The default in Devise for existing
# apps is `200 OK` and `302 Found` respectively, but new apps are generated with
# these new defaults that match Hotwire/Turbo behavior.
# Note: These might become the new default in future versions of Devise.
config.responder.error_status = :unprocessable_content # for Rack 3.1 or higher
# config.responder.error_status = :unprocessable_entity # for Rack 3.0 or lower
config.responder.redirect_status = :see_other
end
```
**Important**: these custom responses require the `responders` gem version to be `3.1.0` or higher, please make sure you update it if you're going to use this configuration. Check [this upgrade guide](https://github.com/heartcombo/devise/wiki/How-To:-Upgrade-to-Devise-4.9.0-[Hotwire-Turbo-integration]) for more info.
_Note_: the above statuses configuration may become the default for Devise in a future release.
There are a couple other changes you might need to make in your app to work with Hotwire/Turbo, if you're migrating from rails-ujs:
* The `data-confirm` option that adds a confirmation modal to buttons/forms before submission needs to change to `data-turbo-confirm`, so that Turbo handles those appropriately.
* The `data-method` option that sets the request method for link submissions needs to change to `data-turbo-method`. This is not necessary for `button_to` or `form`s since Turbo can handle those.
If you're setting up Devise to sign out via `:delete`, and you're using links (instead of buttons wrapped in a form) to sign out with the `method: :delete` option, they will need to be updated as described above. (Devise does not provide sign out links/buttons in its shared views.)
Make sure to inspect your views looking for those, and change appropriately.
### I18n
Devise uses flash messages with I18n, in conjunction with the flash keys :notice and :alert. To customize your app, you can set up your locale file:
```yaml
en:
devise:
sessions:
signed_in: 'Signed in successfully.'
```
You can also create distinct messages based on the resource you've configured using the singular name given in routes:
```yaml
en:
devise:
sessions:
user:
signed_in: 'Welcome user, you are signed in.'
admin:
signed_in: 'Hello admin!'
```
The Devise mailer uses a similar pattern to create subject messages:
```yaml
en:
devise:
mailer:
confirmation_instructions:
subject: 'Hello everybody!'
user_subject: 'Hello User! Please confirm your email'
reset_password_instructions:
subject: 'Reset instructions'
```
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/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.
### Test helpers
Devise includes some test helpers for controller and integration tests.
In order to use them, you need to include the respective module in your test
cases/specs.
### Controller tests
Controller tests require that you include `Devise::Test::IntegrationHelpers` on
your test case or its parent `ActionController::TestCase` superclass.
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::IntegrationHelpers # Rails >= 5
end
```
```ruby
class PostsControllerTest < ActionController::TestCase
include Devise::Test::ControllerHelpers # Rails < 5
end
```
If you're using RSpec, you can put the following inside a file named
`spec/support/devise.rb` or in your `spec/spec_helper.rb` (or
`spec/rails_helper.rb` if you are using `rspec-rails`):
```ruby
RSpec.configure do |config|
config.include Devise::Test::ControllerHelpers, type: :controller
config.include Devise::Test::ControllerHelpers, type: :view
end
```
Just be sure that this inclusion is made *after* the `require 'rspec/rails'` directive.
Now you are ready to use the `sign_in` and `sign_out` methods on your controller
tests:
```ruby
sign_in @user
sign_in @user, scope: :admin
```
If you are testing Devise internal controllers or a controller that inherits
from Devise's, you need to tell Devise which mapping should be used before a
request. This is necessary because Devise gets this information from the router,
but since controller tests do not pass through the router, it needs to be stated
explicitly. For example, if you are testing the user scope, simply use:
```ruby
test 'GET new' do
# Mimic the router behavior of setting the Devise scope through the env.
@request.env['devise.mapping'] = Devise.mappings[:user]
# Use the sign_in helper to sign in a fixture `User` record.
sign_in users(:alice)
get :new
# assert something
end
```
### Integration tests
Integration test helpers are available by including the
`Devise::Test::IntegrationHelpers` module.
```ruby
class PostsTests < ActionDispatch::IntegrationTest
include Devise::Test::IntegrationHelpers
end
```
Now you can use the following `sign_in` and `sign_out` methods in your integration
tests:
```ruby
sign_in users(:bob)
sign_in users(:bob), scope: :admin
sign_out :user
```
RSpec users can include the `IntegrationHelpers` module on their `:feature` specs.
```ruby
RSpec.configure do |config|
config.include Devise::Test::IntegrationHelpers, type: :feature
end
```
Unlike controller tests, integration tests do not need to supply the
`devise.mapping` `env` value, as the mapping can be inferred by the routes that
are executed in your tests.
You can read more about testing your Rails controllers with RSpec in the wiki:
* https://github.com/heartcombo/devise/wiki/How-To:-Test-controllers-with-Rails-(and-RSpec)
### OmniAuth
Devise comes with OmniAuth support out of the box to authenticate with other providers. To use it, simply specify your OmniAuth configuration in `config/initializers/devise.rb`:
```ruby
config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
```
You can read more about OmniAuth support in the wiki:
* https://github.com/heartcombo/devise/wiki/OmniAuth:-Overview
### Configuring multiple models
Devise allows you to set up as many Devise models as you want. If you want to have an Admin model with just authentication and timeout features, in addition to the User model above, just run:
```ruby
# Create a migration with the required fields
create_table :admins do |t|
t.string :email
t.string :encrypted_password
t.timestamps null: false
end
# Inside your Admin model
devise :database_authenticatable, :timeoutable
# Inside your routes
devise_for :admins
# Inside your protected controller
before_action :authenticate_admin!
# Inside your controllers and views
admin_signed_in?
current_admin
admin_session
```
Alternatively, you can simply run the Devise generator.
Keep in mind that those models will have completely different routes. They **do not** and **cannot** share the same controller for sign in, sign out and so on. In case you want to have different roles sharing the same actions, we recommend that you use a role-based approach, by either providing a role column or using a dedicated gem for authorization.
### Active Job Integration
If you are using Active Job to deliver Action Mailer messages in the
background through a queuing back-end, you can send Devise emails through your
existing queue by overriding the `send_devise_notification` method in your model.
```ruby
def send_devise_notification(notification, *args)
devise_mailer.send(notification, self, *args).deliver_later
end
```
### Password reset tokens and Rails logs
If you enable the [Recoverable](https://www.rubydoc.info/gems/devise/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.
Rails sets the production logger level to INFO by default. Consider changing your production logger level to WARN if you wish to prevent tokens from being leaked into your logs. In `config/environments/production.rb`:
```ruby
config.log_level = :warn
```
### Other ORMs
Devise supports ActiveRecord (default) and Mongoid. To select another ORM, simply require it in the initializer file.
### 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). 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/))
#### 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))
The devise default for HTTP Auth is disabled, so it will need to be enabled in the devise initializer for the database strategy:
```ruby
config.http_authenticatable = [:database]
```
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/).
#### 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
Rails.application.config.middleware.insert_before Warden::Manager, ActionDispatch::Cookies
Rails.application.config.middleware.insert_before Warden::Manager, ActionDispatch::Session::CookieStore
```
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/wardencommunity/warden
## License
MIT License.
Copyright 2020-CURRENT Rafael França, Carlos Antonio da Silva.
Copyright 2009-2019 Plataformatec.
The Devise logo is licensed under [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](https://creativecommons.org/licenses/by-nc-nd/4.0/).

View File

@@ -1,260 +0,0 @@
== Devise
Devise is a flexible authentication solution for Rails based on Warden. It:
* Is Rack based;
* Is a complete MVC solution based on Rails engines;
* Allows you to have multiple roles (or models/scopes) signed in at the same time;
* Is based on a modularity concept: use just what you really need.
Right now it's composed of 12 modules:
* Authenticatable: responsible for encrypting password and validating authenticity of a user while signing in.
* Token Authenticatable: validates authenticity of a user while signing in using an authentication token (also known as "single access token").
* HttpAuthenticatable: sign in users using basic HTTP authentication.
* Confirmable: responsible for verifying whether an account is already confirmed to sign in, and to send emails with confirmation instructions.
* Recoverable: takes care of reseting the user password and send reset instructions.
* Registerable: handles signing up users through a registration process.
* Rememberable: manages generating and clearing token for remember the user from a saved cookie.
* Trackable: tracks sign in count, timestamps and ip.
* Timeoutable: expires sessions without activity in a certain period of time.
* Validatable: creates all needed validations for email and password. It's totally optional, so you're able to to customize validations by yourself.
* Lockable: takes care of locking an account based on the number of failed sign in attempts. Handles unlock via expire and email.
* Activatable: if you need to activate accounts by other means, which are not through confirmation, use this module.
There's an example application using Devise at http://github.com/plataformatec/devise_example .
== Dependencies
Devise is based on Warden (http://github.com/hassox/warden), a Rack Authentication Framework so you need to install it as a gem. Please ensure you have it installed in order to use devise (see installation below).
== Installation
All gems are on gemcutter, so you need to add gemcutter to your sources if you haven't yet:
sudo gem sources -a http://gemcutter.org/
Install warden gem if you don't have it installed (requires 0.6.4 or higher):
sudo gem install warden
Install devise gem:
sudo gem install devise
Configure warden and devise gems inside your app:
config.gem 'warden'
config.gem 'devise'
Run the generator:
ruby script/generate devise_install
And you're ready to go. The generator will install an initializer which describes ALL Devise's configuration options, so be sure to take a look at it and the documentation as well:
http://rdoc.info/projects/plataformatec/devise
== Basic Usage
This is a walkthrough with all steps you need to setup a devise resource, including model, migration, route files, and optional configuration. You MUST also check out the *Generators* section below to help you start.
Devise must be set up within the model (or models) you want to use, and devise routes must be created inside your config/routes.rb file.
We're assuming here you want a User model with some modules, as outlined below:
class User < ActiveRecord::Base
devise :authenticatable, :confirmable, :recoverable, :rememberable, :trackable, :validatable
end
After you choose which modules to use, you need to setup your migrations. Luckily, devise has some helpers to save you from this boring work:
create_table :users do |t|
t.authenticatable
t.confirmable
t.recoverable
t.rememberable
t.trackable
t.timestamps
end
Remember that Devise don't rely on _attr_accessible_ or _attr_protected_ inside its modules, so be sure to setup what attributes are accessible or protected in your model.
The next setup after setting up your model is to configure your routes. You do this by opening up your config/routes.rb and adding:
map.devise_for :users
This is going to look inside you User model and create a set of needed routes (you can see them by running `rake routes`).
There are also some options available for configuring your routes, as :class_name (to set the class for that route), :path_prefix, :as and :path_names, where the last two have the same meaning as in common routes. The available :path_names are:
map.devise_for :users, :as => "usuarios", :path_names => { :sign_in => 'login', :sign_out => 'logout', :password => 'secret', :confirmation => 'verification', :unlock => 'unblock' }
Be sure to check devise_for documentation for detailed description.
After this steps, run your migrations, and you are ready to go! But don't finish reading, we still have a lot to tell you:
== Controller filters and helpers
Devise is gonna create some helpers to use inside your controllers and views. To setup a controller that needs user authentication, just add this before_filter:
before_filter :authenticate_user!
To verify if a user is signed in, you have the following helper:
user_signed_in?
And to get the current signed in user this helper is available:
current_user
You have also access to the session for this scope:
user_session
After signing in a user, confirming it's account or updating it's password, devise will look for a scoped root path to redirect. Example: For a :user resource, it will use user_root_path if it exists, otherwise default root_path will be used. This means that you need to set the root inside your routes:
map.root :controller => 'home'
You can also overwrite after_sign_in_path_for and after_sign_out_path_for to customize better your redirect hooks.
Finally, you also need to setup default url options for the mailer in each environment. Here's is the configuration for config/environments/development.rb:
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
== Tidying up
Devise let's you setup as many roles as you want, so let's say you already have this User model and also want an Admin model with just authentication, trackable, lockable and timeoutable stuff and none of confirmation or password recovery. Just follow the same steps:
# Create a migration with the required fields
create_table :admins do |t|
t.authenticatable
t.lockable
t.trackable
end
# Inside your Admin model
devise :authenticatable, :trackable, :timeoutable, :lockable
# Inside your routes
map.devise_for :admin
# Inside your protected controller
before_filter :authenticate_admin!
# Inside your controllers and views
admin_signed_in?
current_admin
admin_session
== Generators
Devise comes with some generators to help you start:
ruby script/generate devise_install
This will generate an initializer, with a description of all configuration values. You can also generate models through:
ruby script/generate devise Model
A model configured with all devise modules and attr_accessible for default fields will be created. The generator will also create the migration and configure your routes for devise.
== Model configuration
The devise method in your models also accept some options to configure its modules. For example, you can chose which encryptor to use in authenticatable:
devise :authenticatable, :confirmable, :recoverable, :encryptor => :bcrypt
Besides :encryptor, you can provide :pepper, :stretches, :confirm_within, :remember_for, :timeout_in, :unlock_in and others. All those are describer in the initializer created when you invoke the devise_install generator describer above.
== Views
Since devise is an engine, it has all default views inside the gem. They are good to get you started, but you will want to customize them at some point. And Devise has a generator to make copy them all to your application:
ruby script/generate devise_views
By default Devise will use the same views for all roles you have. But what if you need so different views to each of them? Devise also has an easy way to accomplish it: just setup config.scoped_views to true inside "config/initializers/devise.rb".
After doing so you will be able to have views based on the scope like 'sessions/users/new' and 'sessions/admin/new'. If no view is found within the scope, Devise will fallback to the default view.
Devise uses flash messages to let users know if their login is successful or not. Devise expects your application to call 'flash[:notice]' and 'flash[:alert]' as appropriate.
== I18n
Devise uses flash messages with I18n with the flash keys :success and :failure. To customize your app, you can setup your locale file this way:
en:
devise:
sessions:
signed_in: 'Signed in successfully.'
You can also create distinct messages based on the resource you've configured using the singular name given in routes:
en:
devise:
sessions:
user:
signed_in: 'Welcome user, you are signed in.'
admin:
signed_in: 'Hello admin!'
Devise mailer uses the same pattern to create subject messages:
en:
devise:
mailer:
confirmation_instructions: 'Hello everybody!'
user:
confirmation_instructions: 'Hello User! Please confirm your email'
reset_password_instructions: 'Reset instructions'
Take a look at our locale file to check all available messages.
== Test helpers
Devise includes some tests helpers for functional specs. To use them, you just need to include Devise::TestHelpers in your test class and use the sign_in and sign_out method. Such methods have the same signature as in controllers:
sign_in :user, @user # sign_in(scope, resource)
sign_in @user # sign_in(resource)
sign_out :user # sign_out(scope)
sign_out @user # sign_out(resource)
You can include the Devise Test Helpers in all of your tests by adding the following to the bottom of your test/test_helper.rb or spec/spec_helper.rb file:
class ActionController::TestCase
include Devise::TestHelpers
end
Do not use such helpers for integration tests like Cucumber, Webrat... Just fill in the form or explicitly set the user in session. For more tips, check the wiki (http://wiki.github.com/plataformatec/devise).
== Migrating from other solutions
Devise implements encryption strategies for Clearance, Authlogic and Restful-Authentication. To make use of it set the desired encryptor in the encryptor initializer config option. You might also need to rename your encrypted password and salt columns to match Devises's one (encrypted_password and password_salt).
== Other ORMs
Devise supports both ActiveRecord (default) and MongoMapper, and has experimental Datamapper supports (in a sense that Devise test suite does not run completely with Datamapper). To choose other ORM, you just need to configure it in the initializer file.
== TODO
Please refer to TODO file.
== Maintainers
* José Valim (http://github.com/josevalim)
* Carlos Antônio da Silva (http://github.com/carlosantoniodasilva)
== Contributors
We have a long running list of contributors. Check them in the CHANGELOG or do `git shortlog -s -n` in the cloned repository.
== Bugs and Feedback
If you discover any bugs or want to drop a line, feel free to create an issue on
GitHub or send an e-mail to the mailing list.
http://github.com/plataformatec/devise/issues
http://groups.google.com/group/plataformatec-devise
MIT License. Copyright 2009 Plataforma Tecnologia. http://blog.plataformatec.com.br

View File

@@ -1,18 +1,20 @@
# encoding: UTF-8
# frozen_string_literal: true
require 'rake'
require 'bundler/gem_tasks'
require 'rake/testtask'
require 'rake/rdoctask'
require File.join(File.dirname(__FILE__), 'lib', 'devise', 'version')
require 'rdoc/task'
desc 'Default: run tests for all ORMs.'
task :default => :pre_commit
task default: :test
desc 'Run Devise tests for all ORMs.'
task :pre_commit do
Dir[File.join(File.dirname(__FILE__), 'test', 'orm', '*.rb')].each do |file|
orm = File.basename(file).split(".").first
system "rake test DEVISE_ORM=#{orm}"
# "Some day, my son, rake's inner wisdom will reveal itself. Until then,
# take this `system` -- may its brute force protect you well."
exit 1 unless system "rake test DEVISE_ORM=#{orm}"
end
end
@@ -22,6 +24,7 @@ Rake::TestTask.new(:test) do |t|
t.libs << 'test'
t.pattern = 'test/**/*_test.rb'
t.verbose = true
t.warning = false
end
desc 'Generate documentation for Devise.'
@@ -29,25 +32,6 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'Devise'
rdoc.options << '--line-numbers' << '--inline-source'
rdoc.rdoc_files.include('README.rdoc')
rdoc.rdoc_files.include('README.md')
rdoc.rdoc_files.include('lib/**/*.rb')
end
begin
require 'jeweler'
Jeweler::Tasks.new do |s|
s.name = "devise"
s.version = Devise::VERSION
s.summary = "Flexible authentication solution for Rails with Warden"
s.email = "contact@plataformatec.com.br"
s.homepage = "http://github.com/plataformatec/devise"
s.description = "Flexible authentication solution for Rails with Warden"
s.authors = ['José Valim', 'Carlos Antônio']
s.files = FileList["[A-Z]*", "{app,config,generators,lib}/**/*", "init.rb"]
s.add_dependency("warden", "~> 0.9.0")
end
Jeweler::GemcutterTasks.new
rescue LoadError
puts "Jeweler, or one of its dependencies, is not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
end

2
TODO
View File

@@ -1,2 +0,0 @@
* Make test run with DataMapper
* Extract Activatable tests from Confirmable

View File

@@ -1,33 +0,0 @@
class ConfirmationsController < ApplicationController
include Devise::Controllers::InternalHelpers
# GET /resource/confirmation/new
def new
build_resource
render_with_scope :new
end
# POST /resource/confirmation
def create
self.resource = resource_class.send_confirmation_instructions(params[resource_name])
if resource.errors.empty?
set_flash_message :notice, :send_instructions
redirect_to new_session_path(resource_name)
else
render_with_scope :new
end
end
# GET /resource/confirmation?confirmation_token=abcdef
def show
self.resource = resource_class.confirm!(:confirmation_token => params[:confirmation_token])
if resource.errors.empty?
set_flash_message :notice, :confirmed
sign_in_and_redirect(resource_name, resource)
else
render_with_scope :new
end
end
end

View File

@@ -0,0 +1,54 @@
# frozen_string_literal: true
class Devise::ConfirmationsController < DeviseController
# GET /resource/confirmation/new
def new
self.resource = resource_class.new
end
# POST /resource/confirmation
def create
self.resource = resource_class.send_confirmation_instructions(resource_params)
yield resource if block_given?
if successfully_sent?(resource)
respond_with({}, location: after_resending_confirmation_instructions_path_for(resource_name))
else
respond_with(resource)
end
end
# GET /resource/confirmation?confirmation_token=abcdef
def show
self.resource = resource_class.confirm_by_token(params[:confirmation_token])
yield resource if block_given?
if resource.errors.empty?
set_flash_message!(:notice, :confirmed)
respond_with_navigational(resource){ redirect_to after_confirmation_path_for(resource_name, resource) }
else
# TODO: use `error_status` when the default changes to `:unprocessable_entity` / `:unprocessable_content`.
respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new }
end
end
protected
# The path used after resending confirmation instructions.
def after_resending_confirmation_instructions_path_for(resource_name)
is_navigational_format? ? new_session_path(resource_name) : '/'
end
# The path used after confirmation.
def after_confirmation_path_for(resource_name, resource)
if signed_in?(resource_name)
signed_in_root_path(resource)
else
new_session_path(resource_name)
end
end
def translation_scope
'devise.confirmations'
end
end

View File

@@ -0,0 +1,36 @@
# frozen_string_literal: true
class Devise::OmniauthCallbacksController < DeviseController
prepend_before_action { request.env["devise.skip_timeout"] = true }
def passthru
render status: 404, plain: "Not found. Authentication passthru."
end
def failure
set_flash_message! :alert, :failure, kind: OmniAuth::Utils.camelize(failed_strategy.name), reason: failure_message
redirect_to after_omniauth_failure_path_for(resource_name)
end
protected
def failed_strategy
request.respond_to?(:get_header) ? request.get_header("omniauth.error.strategy") : request.env["omniauth.error.strategy"]
end
def failure_message
exception = request.respond_to?(:get_header) ? request.get_header("omniauth.error") : request.env["omniauth.error"]
error = exception.error_reason if exception.respond_to?(:error_reason)
error ||= exception.error if exception.respond_to?(:error)
error ||= (request.respond_to?(:get_header) ? request.get_header("omniauth.error.type") : request.env["omniauth.error.type"]).to_s
error.to_s.humanize if error
end
def after_omniauth_failure_path_for(scope)
new_session_path(scope)
end
def translation_scope
'devise.omniauth_callbacks'
end
end

View File

@@ -0,0 +1,83 @@
# frozen_string_literal: true
class Devise::PasswordsController < DeviseController
prepend_before_action :require_no_authentication
# Render the #edit only if coming from a reset password email link
append_before_action :assert_reset_token_passed, only: :edit
# GET /resource/password/new
def new
self.resource = resource_class.new
end
# POST /resource/password
def create
self.resource = resource_class.send_reset_password_instructions(resource_params)
yield resource if block_given?
if successfully_sent?(resource)
respond_with({}, location: after_sending_reset_password_instructions_path_for(resource_name))
else
respond_with(resource)
end
end
# GET /resource/password/edit?reset_password_token=abcdef
def edit
self.resource = resource_class.new
set_minimum_password_length
resource.reset_password_token = params[:reset_password_token]
end
# PUT /resource/password
def update
self.resource = resource_class.reset_password_by_token(resource_params)
yield resource if block_given?
if resource.errors.empty?
resource.unlock_access! if unlockable?(resource)
if resource_class.sign_in_after_reset_password
flash_message = resource.active_for_authentication? ? :updated : :updated_not_active
set_flash_message!(:notice, flash_message)
resource.after_database_authentication
sign_in(resource_name, resource)
else
set_flash_message!(:notice, :updated_not_active)
end
respond_with resource, location: after_resetting_password_path_for(resource)
else
set_minimum_password_length
respond_with resource
end
end
protected
def after_resetting_password_path_for(resource)
resource_class.sign_in_after_reset_password ? after_sign_in_path_for(resource) : new_session_path(resource_name)
end
# The path used after sending reset password instructions
def after_sending_reset_password_instructions_path_for(resource_name)
new_session_path(resource_name) if is_navigational_format?
end
# Check if a reset_password_token is provided in the request
def assert_reset_token_passed
if params[:reset_password_token].blank?
set_flash_message(:alert, :no_token)
redirect_to new_session_path(resource_name)
end
end
# Check if proper Lockable module methods are present & unlock strategy
# allows to unlock resource on password reset
def unlockable?(resource)
resource.respond_to?(:unlock_access!) &&
resource.respond_to?(:unlock_strategy_enabled?) &&
resource.unlock_strategy_enabled?(:email)
end
def translation_scope
'devise.passwords'
end
end

View File

@@ -0,0 +1,168 @@
# frozen_string_literal: true
class Devise::RegistrationsController < DeviseController
prepend_before_action :require_no_authentication, only: [:new, :create, :cancel]
prepend_before_action :authenticate_scope!, only: [:edit, :update, :destroy]
prepend_before_action :set_minimum_password_length, only: [:new, :edit]
# GET /resource/sign_up
def new
build_resource
yield resource if block_given?
respond_with resource
end
# POST /resource
def create
build_resource(sign_up_params)
resource.save
yield resource if block_given?
if resource.persisted?
if resource.active_for_authentication?
set_flash_message! :notice, :signed_up
sign_up(resource_name, resource)
respond_with resource, location: after_sign_up_path_for(resource)
else
set_flash_message! :notice, :"signed_up_but_#{resource.inactive_message}"
expire_data_after_sign_in!
respond_with resource, location: after_inactive_sign_up_path_for(resource)
end
else
clean_up_passwords resource
set_minimum_password_length
respond_with resource
end
end
# GET /resource/edit
def edit
render :edit
end
# PUT /resource
# We need to use a copy of the resource because we don't want to change
# the current user in place.
def update
self.resource = resource_class.to_adapter.get!(send(:"current_#{resource_name}").to_key)
prev_unconfirmed_email = resource.unconfirmed_email if resource.respond_to?(:unconfirmed_email)
resource_updated = update_resource(resource, account_update_params)
yield resource if block_given?
if resource_updated
set_flash_message_for_update(resource, prev_unconfirmed_email)
bypass_sign_in resource, scope: resource_name if sign_in_after_change_password?
respond_with resource, location: after_update_path_for(resource)
else
clean_up_passwords resource
set_minimum_password_length
respond_with resource
end
end
# DELETE /resource
def destroy
resource.destroy
Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name)
set_flash_message! :notice, :destroyed
yield resource if block_given?
respond_with_navigational(resource){ redirect_to after_sign_out_path_for(resource_name), status: Devise.responder.redirect_status }
end
# GET /resource/cancel
# Forces the session data which is usually expired after sign
# in to be expired now. This is useful if the user wants to
# cancel oauth signing in/up in the middle of the process,
# removing all OAuth session data.
def cancel
expire_data_after_sign_in!
redirect_to new_registration_path(resource_name)
end
protected
def update_needs_confirmation?(resource, previous)
resource.respond_to?(:pending_reconfirmation?) &&
resource.pending_reconfirmation? &&
previous != resource.unconfirmed_email
end
# By default we want to require a password checks on update.
# You can overwrite this method in your own RegistrationsController.
def update_resource(resource, params)
resource.update_with_password(params)
end
# Build a devise resource passing in the session. Useful to move
# temporary session data to the newly created user.
def build_resource(hash = {})
self.resource = resource_class.new_with_session(hash, session)
end
# Signs in a user on sign up. You can overwrite this method in your own
# RegistrationsController.
def sign_up(resource_name, resource)
sign_in(resource_name, resource)
end
# The path used after sign up. You need to overwrite this method
# in your own RegistrationsController.
def after_sign_up_path_for(resource)
after_sign_in_path_for(resource) if is_navigational_format?
end
# The path used after sign up for inactive accounts. You need to overwrite
# this method in your own RegistrationsController.
def after_inactive_sign_up_path_for(resource)
scope = Devise::Mapping.find_scope!(resource)
router_name = Devise.mappings[scope].router_name
context = router_name ? send(router_name) : self
context.respond_to?(:root_path) ? context.root_path : "/"
end
# The default url to be used after updating a resource. You need to overwrite
# this method in your own RegistrationsController.
def after_update_path_for(resource)
sign_in_after_change_password? ? signed_in_root_path(resource) : new_session_path(resource_name)
end
# Authenticates the current scope and gets the current resource from the session.
def authenticate_scope!
send(:"authenticate_#{resource_name}!", force: true)
self.resource = send(:"current_#{resource_name}")
end
def sign_up_params
devise_parameter_sanitizer.sanitize(:sign_up)
end
def account_update_params
devise_parameter_sanitizer.sanitize(:account_update)
end
def translation_scope
'devise.registrations'
end
private
def set_flash_message_for_update(resource, prev_unconfirmed_email)
return unless is_flashing_format?
flash_key = if update_needs_confirmation?(resource, prev_unconfirmed_email)
:update_needs_confirmation
elsif sign_in_after_change_password?
:updated
else
:updated_but_not_signed_in
end
set_flash_message :notice, flash_key
end
def sign_in_after_change_password?
return true if account_update_params[:password].blank?
Devise.sign_in_after_change_password
end
end

View File

@@ -0,0 +1,83 @@
# frozen_string_literal: true
class Devise::SessionsController < DeviseController
prepend_before_action :require_no_authentication, only: [:new, :create]
prepend_before_action :allow_params_authentication!, only: :create
prepend_before_action :verify_signed_out_user, only: :destroy
prepend_before_action(only: [:create, :destroy]) { request.env["devise.skip_timeout"] = true }
# GET /resource/sign_in
def new
self.resource = resource_class.new(sign_in_params)
clean_up_passwords(resource)
yield resource if block_given?
respond_with(resource, serialize_options(resource))
end
# POST /resource/sign_in
def create
self.resource = warden.authenticate!(auth_options)
set_flash_message!(:notice, :signed_in)
sign_in(resource_name, resource)
yield resource if block_given?
respond_with resource, location: after_sign_in_path_for(resource)
end
# DELETE /resource/sign_out
def destroy
signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
set_flash_message! :notice, :signed_out if signed_out
yield if block_given?
respond_to_on_destroy(non_navigational_status: :no_content)
end
protected
def sign_in_params
devise_parameter_sanitizer.sanitize(:sign_in)
end
def serialize_options(resource)
methods = resource_class.authentication_keys.dup
methods = methods.keys if methods.is_a?(Hash)
methods << :password if resource.respond_to?(:password)
{ methods: methods, only: [:password] }
end
def auth_options
{ scope: resource_name, recall: "#{controller_path}#new", locale: I18n.locale }
end
def translation_scope
'devise.sessions'
end
private
# Check if there is no signed in user before doing the sign out.
#
# If there is no signed in user, it will set the flash message and redirect
# to the after_sign_out path.
def verify_signed_out_user
if all_signed_out?
set_flash_message! :notice, :already_signed_out
respond_to_on_destroy(non_navigational_status: :unauthorized)
end
end
def all_signed_out?
users = Devise.mappings.keys.map { |s| warden.user(scope: s, run_callbacks: false) }
users.all?(&:blank?)
end
def respond_to_on_destroy(non_navigational_status: :no_content)
# We actually need to hardcode this as Rails default responder doesn't
# support returning empty response on GET request
respond_to do |format|
format.all { head non_navigational_status }
format.any(*navigational_formats) { redirect_to after_sign_out_path_for(resource_name), status: Devise.responder.redirect_status }
end
end
end

View File

@@ -0,0 +1,52 @@
# frozen_string_literal: true
class Devise::UnlocksController < DeviseController
prepend_before_action :require_no_authentication
# GET /resource/unlock/new
def new
self.resource = resource_class.new
end
# POST /resource/unlock
def create
self.resource = resource_class.send_unlock_instructions(resource_params)
yield resource if block_given?
if successfully_sent?(resource)
respond_with({}, location: after_sending_unlock_instructions_path_for(resource))
else
respond_with(resource)
end
end
# GET /resource/unlock?unlock_token=abcdef
def show
self.resource = resource_class.unlock_access_by_token(params[:unlock_token])
yield resource if block_given?
if resource.errors.empty?
set_flash_message! :notice, :unlocked
respond_with_navigational(resource){ redirect_to after_unlock_path_for(resource) }
else
# TODO: use `error_status` when the default changes to `:unprocessable_entity` / `:unprocessable_content`.
respond_with_navigational(resource.errors, status: :unprocessable_entity){ render :new }
end
end
protected
# The path used after sending unlock password instructions
def after_sending_unlock_instructions_path_for(resource)
new_session_path(resource) if is_navigational_format?
end
# The path used after unlocking the resource
def after_unlock_path_for(resource)
new_session_path(resource) if is_navigational_format?
end
def translation_scope
'devise.unlocks'
end
end

View File

@@ -0,0 +1,226 @@
# frozen_string_literal: true
# All Devise controllers are inherited from here.
class DeviseController < Devise.parent_controller.constantize
include Devise::Controllers::ScopedViews
if respond_to?(:helper)
helper DeviseHelper
end
if respond_to?(:helper_method)
helpers = %w(resource scope_name resource_name signed_in_resource
resource_class resource_params devise_mapping)
helper_method(*helpers)
end
prepend_before_action :assert_is_devise_resource!
self.responder = Devise.responder
respond_to :html if mimes_for_respond_to.empty?
# Override prefixes to consider the scoped view.
# Notice we need to check for the request due to a bug in
# Action Controller tests that forces _prefixes to be
# loaded before even having a request object.
#
# This method should be public as it is in ActionPack
# itself. Changing its visibility may break other gems.
def _prefixes #:nodoc:
@_prefixes ||= if self.class.scoped_views? && request && devise_mapping
["#{devise_mapping.scoped_path}/#{controller_name}"] + super
else
super
end
end
# Override internal methods to exclude `_prefixes` from action methods since
# we override it above.
#
# There was an intentional change in Rails 7.1 that will allow it to become
# an action method because it's a public method of a non-abstract controller,
# but we also can't make this abstract because it can affect potential actions
# defined in the parent controller, so instead we ensure `_prefixes` is going
# to be considered internal. (and thus, won't become an action method.)
# Ref: https://github.com/rails/rails/pull/48699
def self.internal_methods #:nodoc:
super << :_prefixes
end
protected
# Gets the actual resource stored in the instance variable
def resource
instance_variable_get(:"@#{resource_name}")
end
# Proxy to devise map name
def resource_name
devise_mapping.name
end
alias :scope_name :resource_name
# Proxy to devise map class
def resource_class
devise_mapping.to
end
# Returns a signed in resource from session (if one exists)
def signed_in_resource
warden.authenticate(scope: resource_name)
end
# Attempt to find the mapped route for devise based on request path
def devise_mapping
@devise_mapping ||= request.env["devise.mapping"]
end
# Checks whether it's a devise mapped resource or not.
def assert_is_devise_resource! #:nodoc:
unknown_action! <<-MESSAGE unless devise_mapping
Could not find devise mapping for path #{request.fullpath.inspect}.
This may happen for two reasons:
1) You forgot to wrap your route inside the scope block. For example:
devise_scope :user do
get "/some/route" => "some_devise_controller"
end
2) You are testing a Devise controller bypassing the router.
If so, you can explicitly tell Devise which mapping to use:
@request.env["devise.mapping"] = Devise.mappings[:user]
MESSAGE
end
# Returns real navigational formats which are supported by Rails
def navigational_formats
@navigational_formats ||= Devise.navigational_formats.select { |format| Mime::EXTENSION_LOOKUP[format.to_s] }
end
def unknown_action!(msg)
logger.debug "[Devise] #{msg}" if logger
raise AbstractController::ActionNotFound, msg
end
# Sets the resource creating an instance variable
def resource=(new_resource)
instance_variable_set(:"@#{resource_name}", new_resource)
end
# Helper for use in before_actions where no authentication is required.
#
# Example:
# before_action :require_no_authentication, only: :new
def require_no_authentication
assert_is_devise_resource!
return unless is_navigational_format?
no_input = devise_mapping.no_input_strategies
authenticated = if no_input.present?
args = no_input.dup.push scope: resource_name
warden.authenticate?(*args)
else
warden.authenticated?(resource_name)
end
if authenticated && resource = warden.user(resource_name)
set_flash_message(:alert, 'already_authenticated', scope: 'devise.failure')
redirect_to after_sign_in_path_for(resource)
end
end
# Helper for use after calling send_*_instructions methods on a resource.
# If we are in paranoid mode, we always act as if the resource was valid
# and instructions were sent.
def successfully_sent?(resource)
notice = if Devise.paranoid
resource.errors.clear
:send_paranoid_instructions
elsif resource.errors.empty?
:send_instructions
end
if notice
set_flash_message! :notice, notice
true
end
end
# Sets the flash message with :key, using I18n. By default you are able
# to set up your messages using specific resource scope, and if no message is
# found we look to the default scope. Set the "now" options key to a true
# value to populate the flash.now hash in lieu of the default flash hash (so
# the flash message will be available to the current action instead of the
# next action).
# Example (i18n locale file):
#
# en:
# devise:
# passwords:
# #default_scope_messages - only if resource_scope is not found
# user:
# #resource_scope_messages
#
# Please refer to README or en.yml locale file to check what messages are
# available.
def set_flash_message(key, kind, options = {})
message = find_message(kind, options)
if options[:now]
flash.now[key] = message if message.present?
else
flash[key] = message if message.present?
end
end
# Sets flash message if is_flashing_format? equals true
def set_flash_message!(key, kind, options = {})
if is_flashing_format?
set_flash_message(key, kind, options)
end
end
# Sets minimum password length to show to user
def set_minimum_password_length
if devise_mapping.validatable?
@minimum_password_length = resource_class.password_length.min
end
end
def devise_i18n_options(options)
options
end
# Get message for given
def find_message(kind, options = {})
options[:scope] ||= translation_scope
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)
end
# Controllers inheriting DeviseController are advised to override this
# method so that other controllers inheriting from them would use
# existing translations.
def translation_scope
"devise.#{controller_name}"
end
def clean_up_passwords(object)
object.clean_up_passwords if object.respond_to?(:clean_up_passwords)
end
def respond_with_navigational(*args, &block)
respond_with(*args) do |format|
format.any(*navigational_formats, &block)
end
end
def resource_params
params.fetch(resource_name, {})
end
ActiveSupport.run_load_hooks(:devise_controller, self)
end

View File

@@ -1,42 +0,0 @@
class PasswordsController < ApplicationController
include Devise::Controllers::InternalHelpers
before_filter :require_no_authentication
# GET /resource/password/new
def new
build_resource
render_with_scope :new
end
# POST /resource/password
def create
self.resource = resource_class.send_reset_password_instructions(params[resource_name])
if resource.errors.empty?
set_flash_message :notice, :send_instructions
redirect_to new_session_path(resource_name)
else
render_with_scope :new
end
end
# GET /resource/password/edit?reset_password_token=abcdef
def edit
self.resource = resource_class.new
resource.reset_password_token = params[:reset_password_token]
render_with_scope :edit
end
# PUT /resource/password
def update
self.resource = resource_class.reset_password!(params[resource_name])
if resource.errors.empty?
set_flash_message :notice, :updated
sign_in_and_redirect(resource_name, resource)
else
render_with_scope :edit
end
end
end

View File

@@ -1,55 +0,0 @@
class RegistrationsController < ApplicationController
include Devise::Controllers::InternalHelpers
before_filter :require_no_authentication, :only => [ :new, :create ]
before_filter :authenticate_scope!, :only => [:edit, :update, :destroy]
# GET /resource/sign_in
def new
build_resource
render_with_scope :new
end
# POST /resource/sign_up
def create
build_resource
if resource.save
flash[:"#{resource_name}_signed_up"] = true
set_flash_message :notice, :signed_up
sign_in_and_redirect(resource_name, resource)
else
render_with_scope :new
end
end
# GET /resource/edit
def edit
render_with_scope :edit
end
# PUT /resource
def update
if self.resource.update_with_password(params[resource_name])
set_flash_message :notice, :updated
redirect_to after_sign_in_path_for(self.resource)
else
render_with_scope :edit
end
end
# DELETE /resource
def destroy
self.resource.destroy
set_flash_message :notice, :destroyed
sign_out_and_redirect(self.resource)
end
protected
# Authenticates the current scope and dup the resource
def authenticate_scope!
send(:"authenticate_#{resource_name}!")
self.resource = send(:"current_#{resource_name}").dup
end
end

View File

@@ -1,45 +0,0 @@
class SessionsController < ApplicationController
include Devise::Controllers::InternalHelpers
before_filter :require_no_authentication, :only => [ :new, :create ]
# GET /resource/sign_in
def new
unless resource_just_signed_up?
Devise::FLASH_MESSAGES.each do |message|
set_now_flash_message :alert, message if params.try(:[], message) == "true"
end
end
build_resource
render_with_scope :new
end
# POST /resource/sign_in
def create
if resource = authenticate(resource_name)
set_flash_message :notice, :signed_in
sign_in_and_redirect(resource_name, resource, true)
else
set_now_flash_message :alert, (warden.message || :invalid)
clean_up_passwords(build_resource)
render_with_scope :new
end
end
# GET /resource/sign_out
def destroy
set_flash_message :notice, :signed_out if signed_in?(resource_name)
sign_out_and_redirect(resource_name)
end
protected
def resource_just_signed_up?
flash[:"#{resource_name}_signed_up"]
end
def clean_up_passwords(object)
object.clean_up_passwords if object.respond_to?(:clean_up_passwords)
end
end

View File

@@ -1,33 +0,0 @@
class UnlocksController < ApplicationController
include Devise::Controllers::InternalHelpers
# GET /resource/unlock/new
def new
build_resource
render_with_scope :new
end
# POST /resource/unlock
def create
self.resource = resource_class.send_unlock_instructions(params[resource_name])
if resource.errors.empty?
set_flash_message :notice, :send_instructions
redirect_to new_session_path(resource_name)
else
render_with_scope :new
end
end
# GET /resource/unlock?unlock_token=abcdef
def show
self.resource = resource_class.unlock!(:unlock_token => params[:unlock_token])
if resource.errors.empty?
set_flash_message :notice, :unlocked
sign_in_and_redirect(resource_name, resource)
else
render_with_scope :new
end
end
end

View File

@@ -0,0 +1,5 @@
# frozen_string_literal: true
# Keeping the helper around for backward compatibility.
module DeviseHelper
end

View File

@@ -0,0 +1,30 @@
# frozen_string_literal: true
if defined?(ActionMailer)
class Devise::Mailer < Devise.parent_mailer.constantize
include Devise::Mailers::Helpers
def confirmation_instructions(record, token, opts = {})
@token = token
devise_mail(record, :confirmation_instructions, opts)
end
def reset_password_instructions(record, token, opts = {})
@token = token
devise_mail(record, :reset_password_instructions, opts)
end
def unlock_instructions(record, token, opts = {})
@token = token
devise_mail(record, :unlock_instructions, opts)
end
def email_changed(record, opts = {})
devise_mail(record, :email_changed, opts)
end
def password_change(record, opts = {})
devise_mail(record, :password_change, opts)
end
end
end

View File

@@ -1,68 +0,0 @@
class DeviseMailer < ::ActionMailer::Base
extend Devise::Controllers::InternalHelpers::ScopedViews
# Deliver confirmation instructions when the user is created or its email is
# updated, and also when confirmation is manually requested
def confirmation_instructions(record)
setup_mail(record, :confirmation_instructions)
end
# Deliver reset password instructions when manually requested
def reset_password_instructions(record)
setup_mail(record, :reset_password_instructions)
end
def unlock_instructions(record)
setup_mail(record, :unlock_instructions)
end
private
# Configure default email options
def setup_mail(record, key)
mapping = Devise::Mapping.find_by_class(record.class)
raise "Invalid devise resource #{record}" unless mapping
subject translate(mapping, key)
from mailer_sender(mapping)
recipients record.email
sent_on Time.now
content_type 'text/html'
body render_with_scope(key, mapping, mapping.name => record, :resource => record)
end
def render_with_scope(key, mapping, assigns)
if self.class.scoped_views
begin
render :file => "devise_mailer/#{mapping.as}/#{key}", :body => assigns
rescue ActionView::MissingTemplate
render :file => "devise_mailer/#{key}", :body => assigns
end
else
render :file => "devise_mailer/#{key}", :body => assigns
end
end
def mailer_sender(mapping)
if Devise.mailer_sender.is_a?(Proc)
block_args = mapping.name if Devise.mailer_sender.arity > 0
Devise.mailer_sender.call(block_args)
else
Devise.mailer_sender
end
end
# Setup subject namespaced by model. It means you're able to setup your
# messages using specific resource scope, or provide a default one.
# Example (i18n locale file):
#
# en:
# devise:
# mailer:
# confirmation_instructions: '...'
# user:
# confirmation_instructions: '...'
def translate(mapping, key)
I18n.t(:"#{mapping.name}.#{key}", :scope => [:devise, :mailer], :default => key)
end
end

View File

@@ -1,12 +0,0 @@
<h2>Resend confirmation instructions</h2>
<% form_for resource_name, resource, :url => confirmation_path(resource_name) do |f| %>
<%= f.error_messages %>
<p><%= f.label :email %></p>
<p><%= f.text_field :email %></p>
<p><%= f.submit "Resend confirmation instructions" %></p>
<% end %>
<%= render :partial => "shared/devise_links" %>

View File

@@ -0,0 +1,16 @@
<h2>Resend confirmation instructions</h2>
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<div class="field">
<p><%= f.label :email %></p>
<p><%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %></p>
</div>
<div class="actions">
<%= f.submit "Resend confirmation instructions" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@@ -0,0 +1,5 @@
<p>Welcome <%= @email %>!</p>
<p>You can confirm your account email through the link below:</p>
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>

View File

@@ -0,0 +1,7 @@
<p>Hello <%= @email %>!</p>
<% if @resource.try(:unconfirmed_email?) %>
<p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
<% else %>
<p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p>
<% end %>

View File

@@ -0,0 +1,3 @@
<p>Hello <%= @resource.email %>!</p>
<p>We're contacting you to notify you that your password has been changed.</p>

View File

@@ -0,0 +1,8 @@
<p>Hello <%= @resource.email %>!</p>
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
<p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
<p>If you didn't request this, please ignore this email.</p>
<p>Your password won't change until you access the link above and create a new one.</p>

View File

@@ -0,0 +1,7 @@
<p>Hello <%= @resource.email %>!</p>
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
<p>Click the link below to unlock your account:</p>
<p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>

View File

@@ -0,0 +1,25 @@
<h2>Change your password</h2>
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<%= f.hidden_field :reset_password_token %>
<div class="field">
<p><%= f.label :password, "New password" %></p>
<% if @minimum_password_length %>
<p><em>(<%= @minimum_password_length %> characters minimum)</em></p>
<% end %>
<p><%= f.password_field :password, autofocus: true, autocomplete: "new-password" %></p>
</div>
<div class="field">
<p><%= f.label :password_confirmation, "Confirm new password" %></p>
<p><%= f.password_field :password_confirmation, autocomplete: "new-password" %></p>
</div>
<div class="actions">
<%= f.submit "Change my password" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@@ -0,0 +1,16 @@
<h2>Forgot your password?</h2>
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<div class="field">
<p><%= f.label :email %></p>
<p><%= f.email_field :email, autofocus: true, autocomplete: "email" %></p>
</div>
<div class="actions">
<%= f.submit "Send me password reset instructions" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@@ -0,0 +1,42 @@
<h2>Edit <%= resource_name.to_s.humanize %></h2>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<div class="field">
<p><%= f.label :email %></p>
<p><%= f.email_field :email, autofocus: true, autocomplete: "email" %></p>
</div>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
<% end %>
<div class="field">
<p><%= f.label :password %> <i>(leave blank if you don't want to change it)</i></p>
<p><%= f.password_field :password, autocomplete: "new-password" %></p>
<% if @minimum_password_length %>
<p><em><%= @minimum_password_length %> characters minimum</em></p>
<% end %>
</div>
<div class="field">
<p><%= f.label :password_confirmation %></p>
<p><%= f.password_field :password_confirmation, autocomplete: "new-password" %></p>
</div>
<div class="field">
<p><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i></p>
<p><%= f.password_field :current_password, autocomplete: "current-password" %></p>
</div>
<div class="actions">
<%= f.submit "Update" %>
</div>
<% end %>
<h3>Cancel my account</h3>
<div>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?" }, method: :delete %></div>
<%= link_to "Back", :back %>

View File

@@ -0,0 +1,29 @@
<h2>Sign up</h2>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<div class="field">
<p><%= f.label :email %></p>
<p><%= f.email_field :email, autofocus: true, autocomplete: "email" %></p>
</div>
<div class="field">
<p><%= f.label :password %></p>
<% if @minimum_password_length %>
<p><em>(<%= @minimum_password_length %> characters minimum)</em></p>
<% end %>
<p><%= f.password_field :password, autocomplete: "new-password" %></p>
</div>
<div class="field">
<p><%= f.label :password_confirmation %></p>
<p><%= f.password_field :password_confirmation, autocomplete: "new-password" %></p>
</div>
<div class="actions">
<%= f.submit "Sign up" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@@ -0,0 +1,26 @@
<h2>Log in</h2>
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="field">
<p><%= f.label :email %></p>
<p><%= f.email_field :email, autofocus: true, autocomplete: "email" %></p>
</div>
<div class="field">
<p><%= f.label :password %></p>
<p><%= f.password_field :password, autocomplete: "current-password" %></p>
</div>
<% if devise_mapping.rememberable? %>
<div class="field">
<p><%= f.check_box :remember_me %></p>
<p><%= f.label :remember_me %></p>
</div>
<% end %>
<div class="actions">
<%= f.submit "Log in" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@@ -0,0 +1,15 @@
<% if resource.errors.any? %>
<div id="error_explanation" data-turbo-temporary>
<h2>
<%= I18n.t("errors.messages.not_saved",
count: resource.errors.count,
resource: resource.class.model_name.human.downcase)
%>
</h2>
<ul>
<% resource.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
<% end %>

View File

@@ -0,0 +1,25 @@
<%- if controller_name != 'sessions' %>
<p><%= link_to "Log in", new_session_path(resource_name) %></p>
<% end %>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<p><%= link_to "Sign up", new_registration_path(resource_name) %></p>
<% end %>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
<p><%= link_to "Forgot your password?", new_password_path(resource_name) %></p>
<% end %>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<p><%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %></p>
<% end %>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
<p><%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %></p>
<% end %>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
<p><%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %></p>
<% end %>
<% end %>

View File

@@ -0,0 +1,16 @@
<h2>Resend unlock instructions</h2>
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
<%= render "devise/shared/error_messages", resource: resource %>
<div class="field">
<p><%= f.label :email %></p>
<p><%= f.email_field :email, autofocus: true, autocomplete: "email" %></p>
</div>
<div class="actions">
<%= f.submit "Resend unlock instructions" %>
</div>
<% end %>
<%= render "devise/shared/links" %>

View File

@@ -1,5 +0,0 @@
Welcome <%= @resource.email %>!
You can confirm your account through the link below:
<%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %>

View File

@@ -1,7 +0,0 @@
Hello <%= @resource.email %>!
Your account has been locked due to an excessive amount of unsuccessful sign in attempts.
Click the link below to unlock your account:
<%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %>

View File

@@ -1,16 +0,0 @@
<h2>Change your password</h2>
<% form_for resource_name, resource, :url => password_path(resource_name), :html => { :method => :put } do |f| %>
<%= f.error_messages %>
<%= f.hidden_field :reset_password_token %>
<p><%= f.label :password %></p>
<p><%= f.password_field :password %></p>
<p><%= f.label :password_confirmation %></p>
<p><%= f.password_field :password_confirmation %></p>
<p><%= f.submit "Change my password" %></p>
<% end %>
<%= render :partial => "shared/devise_links" %>

View File

@@ -1,12 +0,0 @@
<h2>Forgot your password?</h2>
<% form_for resource_name, resource, :url => password_path(resource_name) do |f| %>
<%= f.error_messages %>
<p><%= f.label :email %></p>
<p><%= f.text_field :email %></p>
<p><%= f.submit "Send me reset password instructions" %></p>
<% end %>
<%= render :partial => "shared/devise_links" %>

View File

@@ -1,25 +0,0 @@
<h2>Edit <%= resource_name.to_s.humanize %></h2>
<% form_for resource_name, resource, :url => registration_path(resource_name), :html => { :method => :put } do |f| -%>
<%= f.error_messages %>
<p><%= f.label :email %></p>
<p><%= f.text_field :email %></p>
<p><%= f.label :password %> <i>(leave blank if you don't want to change it)</i></p>
<p><%= f.password_field :password %></p>
<p><%= f.label :password_confirmation %></p>
<p><%= f.password_field :password_confirmation %></p>
<p><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i></p>
<p><%= f.password_field :current_password %></p>
<p><%= f.submit "Update" %></p>
<% end -%>
<h3>Cancel my account</h3>
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p>
<%= render :partial => "shared/devise_links" %>

View File

@@ -1,17 +0,0 @@
<h2>Sign up</h2>
<% form_for resource_name, resource, :url => registration_path(resource_name) do |f| -%>
<%= f.error_messages %>
<p><%= f.label :email %></p>
<p><%= f.text_field :email %></p>
<p><%= f.label :password %></p>
<p><%= f.password_field :password %></p>
<p><%= f.label :password_confirmation %></p>
<p><%= f.password_field :password_confirmation %></p>
<p><%= f.submit "Sign up" %></p>
<% end -%>
<%= render :partial => "shared/devise_links" %>

View File

@@ -1,17 +0,0 @@
<h2>Sign in</h2>
<% form_for resource_name, resource, :url => session_path(resource_name) do |f| -%>
<p><%= f.label :email %></p>
<p><%= f.text_field :email %></p>
<p><%= f.label :password %></p>
<p><%= f.password_field :password %></p>
<% if devise_mapping.rememberable? -%>
<p><%= f.check_box :remember_me %> <%= f.label :remember_me %></p>
<% end -%>
<p><%= f.submit "Sign in" %></p>
<% end -%>
<%= render :partial => "shared/devise_links" %>

View File

@@ -1,19 +0,0 @@
<%- if controller_name != 'sessions' %>
<%= link_to t('devise.sessions.link'), new_session_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
<%= link_to t('devise.registrations.link'), new_registration_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
<%= link_to t('devise.passwords.link'), new_password_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
<%= link_to t('devise.confirmations.link'), new_confirmation_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.lockable? && controller_name != 'unlocks' %>
<%= link_to t('devise.unlocks.link'), new_unlock_path(resource_name) %><br />
<% end -%>

View File

@@ -1,12 +0,0 @@
<h2>Resend unlock instructions</h2>
<% form_for resource_name, resource, :url => unlock_path(resource_name) do |f| %>
<%= f.error_messages %>
<p><%= f.label :email %></p>
<p><%= f.text_field :email %></p>
<p><%= f.submit "Resend unlock instructions" %></p>
<% end %>
<%= render :partial => "shared/devise_links" %>

12
bin/test Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env ruby
$: << File.expand_path(File.expand_path('../../test', __FILE__))
require 'bundler/setup'
require 'rails/test_unit/runner'
require 'rails/test_unit/reporter'
require 'rails/test_unit/line_filtering'
Rails::TestUnitReporter.executable = 'bin/test'
Rails::TestUnit::Runner.parse_options(ARGV)
Rails::TestUnit::Runner.run(ARGV)

65
config/locales/en.yml Normal file
View File

@@ -0,0 +1,65 @@
# Additional translations at https://github.com/heartcombo/devise/wiki/I18n
en:
devise:
confirmations:
confirmed: "Your email address has been successfully confirmed."
send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
failure:
already_authenticated: "You are already signed in."
inactive: "Your account is not activated yet."
invalid: "Invalid %{authentication_keys} or password."
locked: "Your account is locked."
last_attempt: "You have one more attempt before your account is locked."
not_found_in_database: "Invalid %{authentication_keys} or password."
timeout: "Your session expired. Please sign in again to continue."
unauthenticated: "You need to sign in or sign up before continuing."
unconfirmed: "You have to confirm your email address before continuing."
mailer:
confirmation_instructions:
subject: "Confirmation instructions"
reset_password_instructions:
subject: "Reset password instructions"
unlock_instructions:
subject: "Unlock instructions"
email_changed:
subject: "Email Changed"
password_change:
subject: "Password Changed"
omniauth_callbacks:
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
success: "Successfully authenticated from %{kind} account."
passwords:
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
updated: "Your password has been changed successfully. You are now signed in."
updated_not_active: "Your password has been changed successfully."
registrations:
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
signed_up: "Welcome! You have signed up successfully."
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirmation link to confirm your new email address."
updated: "Your account has been updated successfully."
updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again."
sessions:
signed_in: "Signed in successfully."
signed_out: "Signed out successfully."
already_signed_out: "Signed out successfully."
unlocks:
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
errors:
messages:
already_confirmed: "was already confirmed, please try signing in"
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
expired: "has expired, please request a new one"
not_found: "not found"
not_locked: "was not locked"
not_saved:
one: "1 error prohibited this %{resource} from being saved:"
other: "%{count} errors prohibited this %{resource} from being saved:"

View File

@@ -1,179 +1,35 @@
# Generated by jeweler
# DO NOT EDIT THIS FILE DIRECTLY
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
# -*- encoding: utf-8 -*-
# frozen_string_literal: true
$:.push File.expand_path("../lib", __FILE__)
require "devise/version"
Gem::Specification.new do |s|
s.name = %q{devise}
s.version = "1.0.1"
s.name = "devise"
s.version = Devise::VERSION.dup
s.platform = Gem::Platform::RUBY
s.licenses = ["MIT"]
s.summary = "Flexible authentication solution for Rails with Warden"
s.email = "heartcombo.oss@gmail.com"
s.homepage = "https://github.com/heartcombo/devise"
s.description = "Flexible authentication solution for Rails with Warden"
s.authors = ['José Valim', 'Carlos Antônio']
s.metadata = {
"homepage_uri" => "https://github.com/heartcombo/devise",
"documentation_uri" => "https://rubydoc.info/github/heartcombo/devise",
"changelog_uri" => "https://github.com/heartcombo/devise/blob/main/CHANGELOG.md",
"source_code_uri" => "https://github.com/heartcombo/devise",
"bug_tracker_uri" => "https://github.com/heartcombo/devise/issues",
"wiki_uri" => "https://github.com/heartcombo/devise/wiki"
}
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Jos\303\251 Valim", "Carlos Ant\303\264nio"]
s.date = %q{2010-02-15}
s.description = %q{Flexible authentication solution for Rails with Warden}
s.email = %q{contact@plataformatec.com.br}
s.extra_rdoc_files = [
"README.rdoc",
"TODO"
]
s.files = [
"CHANGELOG.rdoc",
"MIT-LICENSE",
"README.rdoc",
"Rakefile",
"TODO",
"app/controllers/confirmations_controller.rb",
"app/controllers/passwords_controller.rb",
"app/controllers/registrations_controller.rb",
"app/controllers/sessions_controller.rb",
"app/controllers/unlocks_controller.rb",
"app/models/devise_mailer.rb",
"app/views/confirmations/new.html.erb",
"app/views/devise_mailer/confirmation_instructions.html.erb",
"app/views/devise_mailer/reset_password_instructions.html.erb",
"app/views/devise_mailer/unlock_instructions.html.erb",
"app/views/passwords/edit.html.erb",
"app/views/passwords/new.html.erb",
"app/views/registrations/edit.html.erb",
"app/views/registrations/new.html.erb",
"app/views/sessions/new.html.erb",
"app/views/shared/_devise_links.erb",
"app/views/unlocks/new.html.erb",
"generators/devise/USAGE",
"generators/devise/devise_generator.rb",
"generators/devise/lib/route_devise.rb",
"generators/devise/templates/migration.rb",
"generators/devise/templates/model.rb",
"generators/devise_install/USAGE",
"generators/devise_install/devise_install_generator.rb",
"generators/devise_install/templates/README",
"generators/devise_install/templates/devise.rb",
"generators/devise_views/USAGE",
"generators/devise_views/devise_views_generator.rb",
"init.rb",
"lib/devise.rb",
"lib/devise/controllers/helpers.rb",
"lib/devise/controllers/internal_helpers.rb",
"lib/devise/controllers/url_helpers.rb",
"lib/devise/encryptors/authlogic_sha512.rb",
"lib/devise/encryptors/base.rb",
"lib/devise/encryptors/bcrypt.rb",
"lib/devise/encryptors/clearance_sha1.rb",
"lib/devise/encryptors/restful_authentication_sha1.rb",
"lib/devise/encryptors/sha1.rb",
"lib/devise/encryptors/sha512.rb",
"lib/devise/failure_app.rb",
"lib/devise/hooks/activatable.rb",
"lib/devise/hooks/rememberable.rb",
"lib/devise/hooks/timeoutable.rb",
"lib/devise/hooks/trackable.rb",
"lib/devise/locales/en.yml",
"lib/devise/mapping.rb",
"lib/devise/models.rb",
"lib/devise/models/activatable.rb",
"lib/devise/models/authenticatable.rb",
"lib/devise/models/confirmable.rb",
"lib/devise/models/http_authenticatable.rb",
"lib/devise/models/lockable.rb",
"lib/devise/models/recoverable.rb",
"lib/devise/models/registerable.rb",
"lib/devise/models/rememberable.rb",
"lib/devise/models/timeoutable.rb",
"lib/devise/models/token_authenticatable.rb",
"lib/devise/models/trackable.rb",
"lib/devise/models/validatable.rb",
"lib/devise/orm/active_record.rb",
"lib/devise/orm/data_mapper.rb",
"lib/devise/orm/mongo_mapper.rb",
"lib/devise/rails.rb",
"lib/devise/rails/routes.rb",
"lib/devise/rails/warden_compat.rb",
"lib/devise/schema.rb",
"lib/devise/strategies/authenticatable.rb",
"lib/devise/strategies/base.rb",
"lib/devise/strategies/http_authenticatable.rb",
"lib/devise/strategies/rememberable.rb",
"lib/devise/strategies/token_authenticatable.rb",
"lib/devise/test_helpers.rb",
"lib/devise/version.rb"
]
s.homepage = %q{http://github.com/plataformatec/devise}
s.rdoc_options = ["--charset=UTF-8"]
s.files = Dir["{app,config,lib}/**/*", "CHANGELOG.md", "MIT-LICENSE", "README.md"]
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.5}
s.summary = %q{Flexible authentication solution for Rails with Warden}
s.test_files = [
"test/controllers/helpers_test.rb",
"test/controllers/internal_helpers_test.rb",
"test/controllers/url_helpers_test.rb",
"test/devise_test.rb",
"test/encryptors_test.rb",
"test/failure_app_test.rb",
"test/integration/authenticatable_test.rb",
"test/integration/confirmable_test.rb",
"test/integration/http_authenticatable_test.rb",
"test/integration/lockable_test.rb",
"test/integration/recoverable_test.rb",
"test/integration/registerable_test.rb",
"test/integration/rememberable_test.rb",
"test/integration/timeoutable_test.rb",
"test/integration/token_authenticatable_test.rb",
"test/integration/trackable_test.rb",
"test/mailers/confirmation_instructions_test.rb",
"test/mailers/reset_password_instructions_test.rb",
"test/mailers/unlock_instructions_test.rb",
"test/mapping_test.rb",
"test/models/authenticatable_test.rb",
"test/models/confirmable_test.rb",
"test/models/lockable_test.rb",
"test/models/recoverable_test.rb",
"test/models/rememberable_test.rb",
"test/models/timeoutable_test.rb",
"test/models/token_authenticatable_test.rb",
"test/models/trackable_test.rb",
"test/models/validatable_test.rb",
"test/models_test.rb",
"test/orm/active_record.rb",
"test/orm/mongo_mapper.rb",
"test/rails_app/app/active_record/admin.rb",
"test/rails_app/app/active_record/user.rb",
"test/rails_app/app/controllers/admins_controller.rb",
"test/rails_app/app/controllers/application_controller.rb",
"test/rails_app/app/controllers/home_controller.rb",
"test/rails_app/app/controllers/users_controller.rb",
"test/rails_app/app/helpers/application_helper.rb",
"test/rails_app/app/mongo_mapper/admin.rb",
"test/rails_app/app/mongo_mapper/user.rb",
"test/rails_app/config/boot.rb",
"test/rails_app/config/environment.rb",
"test/rails_app/config/environments/development.rb",
"test/rails_app/config/environments/production.rb",
"test/rails_app/config/environments/test.rb",
"test/rails_app/config/initializers/devise.rb",
"test/rails_app/config/initializers/inflections.rb",
"test/rails_app/config/initializers/new_rails_defaults.rb",
"test/rails_app/config/initializers/session_store.rb",
"test/rails_app/config/routes.rb",
"test/routes_test.rb",
"test/support/assertions_helper.rb",
"test/support/integration_tests_helper.rb",
"test/support/test_silencer.rb",
"test/support/tests_helper.rb",
"test/test_helper.rb",
"test/test_helpers_test.rb"
]
s.required_ruby_version = '>= 2.7.0'
if s.respond_to? :specification_version then
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
s.specification_version = 3
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
s.add_runtime_dependency(%q<warden>, ["~> 0.9.0"])
else
s.add_dependency(%q<warden>, ["~> 0.9.0"])
end
else
s.add_dependency(%q<warden>, ["~> 0.9.0"])
end
s.add_dependency("warden", "~> 1.2.3")
s.add_dependency("orm_adapter", "~> 0.1")
s.add_dependency("bcrypt", "~> 3.0")
s.add_dependency("railties", ">= 7.0")
s.add_dependency("responders")
end

BIN
devise.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,31 @@
source "https://rubygems.org"
gemspec path: ".."
gem "rails", "~> 7.0.0"
gem "omniauth"
gem "omniauth-oauth2"
gem "rdoc"
gem "rails-controller-testing"
gem "responders", "~> 3.1"
group :test do
gem "omniauth-facebook"
gem "omniauth-openid"
gem "rexml"
gem "timecop"
gem "webrat", "0.7.3", require: false
gem "mocha", "~> 2.1", require: false
gem "minitest", "< 6"
gem "ostruct"
end
platforms :ruby do
gem "sqlite3", "~> 1.4"
end
group :mongoid do
gem "mongoid", "~> 7.5"
end

View File

@@ -0,0 +1,31 @@
source "https://rubygems.org"
gemspec path: ".."
gem "rails", "~> 7.1.0"
gem "omniauth"
gem "omniauth-oauth2"
gem "rdoc"
gem "rails-controller-testing"
gem "responders", "~> 3.1"
group :test do
gem "omniauth-facebook"
gem "omniauth-openid"
gem "rexml"
gem "timecop"
gem "webrat"
gem "mocha", "~> 2.1", require: false
gem "minitest", "< 6"
gem "ostruct"
end
platforms :ruby do
gem "sqlite3", "~> 1.4"
end
group :mongoid do
gem "mongoid", "~> 8.1"
end

View File

@@ -0,0 +1,32 @@
source "https://rubygems.org"
gemspec path: ".."
gem "rails", "~> 7.1.0"
gem "omniauth"
gem "omniauth-oauth2"
gem "rdoc"
gem "rails-controller-testing"
gem "responders", "~> 3.1"
group :test do
gem "omniauth-facebook"
gem "omniauth-openid"
gem "rexml"
gem "timecop"
gem "webrat", require: false
gem "mocha", "~> 2.1", require: false
gem "minitest", "< 6"
gem "ostruct"
end
platforms :ruby do
gem "sqlite3"
end
group :mongoid do
gem "mongoid", "~> 8.1"
end

View File

@@ -0,0 +1,31 @@
source "https://rubygems.org"
gemspec path: ".."
gem "rails", "~> 8.0.0"
gem "omniauth"
gem "omniauth-oauth2"
gem "rdoc"
gem "rails-controller-testing"
gem "responders", "~> 3.1"
group :test do
gem "omniauth-facebook"
gem "omniauth-openid"
gem "rexml"
gem "timecop"
gem 'webrat'
gem "mocha", "~> 2.1", require: false
gem "minitest", "< 6"
gem "ostruct"
end
platforms :ruby do
gem "sqlite3"
end
group :mongoid do
gem "mongoid", "~> 8.1"
end

View File

@@ -0,0 +1,31 @@
source "https://rubygems.org"
gemspec path: ".."
gem "rails", github: "rails/rails", branch: "main"
gem "omniauth"
gem "omniauth-oauth2"
gem "rdoc"
gem "rails-controller-testing"
gem "responders", "~> 3.1"
group :test do
gem "omniauth-facebook"
gem "omniauth-openid"
gem "rexml"
gem "timecop"
gem "webrat", "0.7.3", require: false
gem "mocha", "~> 2.1", require: false
gem "minitest", "< 6"
gem "ostruct"
end
platforms :ruby do
gem "sqlite3"
end
group :mongoid do
gem "mongoid", github: "mongodb/mongoid", branch: "master"
end

View File

@@ -1,5 +0,0 @@
To create a devise resource user:
script/generate devise User
This will generate a model named User, a route map for devise called :users, and a migration file for table :users with all devise modules.

View File

@@ -1,15 +0,0 @@
require File.expand_path(File.dirname(__FILE__) + "/lib/route_devise.rb")
class DeviseGenerator < Rails::Generator::NamedBase
def manifest
record do |m|
m.directory(File.join('app', 'models', class_path))
m.template 'model.rb', File.join('app', 'models', "#{file_path}.rb")
m.migration_template 'migration.rb', 'db/migrate', :migration_file_name => "devise_create_#{table_name}"
m.route_devise table_name
end
end
end

View File

@@ -1,32 +0,0 @@
module Rails
module Generator
module Commands
class Create < Base
# Create devise route. Based on route_resources
def route_devise(*resources)
resource_list = resources.map { |r| r.to_sym.inspect }.join(', ')
sentinel = 'ActionController::Routing::Routes.draw do |map|'
logger.route "map.devise_for #{resource_list}"
unless options[:pretend]
gsub_file 'config/routes.rb', /(#{Regexp.escape(sentinel)})/mi do |match|
"#{match}\n map.devise_for #{resource_list}\n"
end
end
end
end
class Destroy < RewindBase
# Destroy devise route. Based on route_resources
def route_devise(*resources)
resource_list = resources.map { |r| r.to_sym.inspect }.join(', ')
look_for = "\n map.devise_for #{resource_list}\n"
logger.route "map.devise_for #{resource_list}"
gsub_file 'config/routes.rb', /(#{look_for})/mi, ''
end
end
end
end
end

View File

@@ -1,23 +0,0 @@
class DeviseCreate<%= table_name.camelize %> < ActiveRecord::Migration
def self.up
create_table(:<%= table_name %>) do |t|
t.authenticatable :encryptor => :sha1, :null => false
t.confirmable
t.recoverable
t.rememberable
t.trackable
# t.lockable
t.timestamps
end
add_index :<%= table_name %>, :email, :unique => true
add_index :<%= table_name %>, :confirmation_token, :unique => true
add_index :<%= table_name %>, :reset_password_token, :unique => true
# add_index :<%= table_name %>, :unlock_token, :unique => true
end
def self.down
drop_table :<%= table_name %>
end
end

View File

@@ -1,9 +0,0 @@
class <%= class_name %> < ActiveRecord::Base
# Include default devise modules. Others available are:
# :http_authenticatable, :token_authenticatable, :lockable, :timeoutable and :activatable
devise :registerable, :authenticatable, :confirmable, :recoverable,
:rememberable, :trackable, :validatable
# Setup accessible (or protected) attributes for your model
attr_accessible :email, :password, :password_confirmation
end

View File

@@ -1,3 +0,0 @@
To copy a Devise initializer to your Rails App, with some configuration values, just do:
script/generate devise_install

View File

@@ -1,15 +0,0 @@
class DeviseInstallGenerator < Rails::Generator::Base
def manifest
record do |m|
m.directory "config/initializers"
m.template "devise.rb", "config/initializers/devise.rb"
m.directory "config/locales"
m.file "../../../lib/devise/locales/en.yml", "config/locales/devise.en.yml"
m.readme "README"
end
end
end

View File

@@ -1,18 +0,0 @@
===============================================================================
Some setup you must do manually if you haven't yet:
1. Setup default url options for your specific environment. Here is an
example of development environment:
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
This is a required Rails configuration. In production is must be the
actual host of your application
2. Ensure you have defined root_url to *something* in your config/routes.rb:
map.root :controller => 'home'
===============================================================================

View File

@@ -1,102 +0,0 @@
# Use this hook to configure devise mailer, warden hooks and so forth. The first
# four configuration values can also be set straight in your models.
Devise.setup do |config|
# Configure the e-mail address which will be shown in DeviseMailer.
config.mailer_sender = "please-change-me@config-initializers-devise.com"
# ==> Configuration for :authenticatable
# Invoke `rake secret` and use the printed value to setup a pepper to generate
# the encrypted password. By default no pepper is used.
# config.pepper = "rake secret output"
# Configure how many times you want the password is reencrypted. Default is 10.
# config.stretches = 10
# Define which will be the encryption algorithm. Supported algorithms are :sha1
# (default), :sha512 and :bcrypt. Devise also supports encryptors from others
# authentication tools as :clearance_sha1, :authlogic_sha512 (then you should set
# stretches above to 20 for default behavior) and :restful_authentication_sha1
# (then you should set stretches to 10, and copy REST_AUTH_SITE_KEY to pepper)
# config.encryptor = :sha1
# Configure which keys are used when authenticating an user. By default is
# just :email. You can configure it to use [:username, :subdomain], so for
# authenticating an user, both parameters are required. Remember that those
# parameters are used only when authenticating and not when retrieving from
# session. If you need permissions, you should implement that in a before filter.
# config.authentication_keys = [ :email ]
# The realm used in Http Basic Authentication
# config.http_authentication_realm = "Application"
# ==> Configuration for :confirmable
# The time you want give to your user to confirm his account. During this time
# he will be able to access your application without confirming. Default is nil.
# config.confirm_within = 2.days
# ==> Configuration for :rememberable
# The time the user will be remembered without asking for credentials again.
# config.remember_for = 2.weeks
# ==> Configuration for :timeoutable
# The time you want to timeout the user session without activity. After this
# time the user will be asked for credentials again.
# config.timeout_in = 10.minutes
# ==> Configuration for :lockable
# Number of authentication tries before locking an account.
# config.maximum_attempts = 20
# Defines which strategy will be used to unlock an account.
# :email = Sends an unlock link to the user email
# :time = Reanables login after a certain ammount of time (see :unlock_in below)
# :both = enables both strategies
# config.unlock_strategy = :both
# Time interval to unlock the account if :time is enabled as unlock_strategy.
# config.unlock_in = 1.hour
# ==> Configuration for :token_authenticatable
# Defines name of the authentication token params key
# config.token_authentication_key = :auth_token
# ==> General configuration
# Load and configure the ORM. Supports :active_record (default), :mongo_mapper
# (requires mongo_ext installed) and :data_mapper (experimental).
# require 'devise/orm/mongo_mapper'
# config.orm = :mongo_mapper
# Turn scoped views on. Before rendering "sessions/new", it will first check for
# "sessions/users/new". It's turned off by default because it's slower if you
# are using only default views.
# config.scoped_views = true
# By default, devise detects the role accessed based on the url. So whenever
# accessing "/users/sign_in", it knows you are accessing an User. This makes
# routes as "/sign_in" not possible, unless you tell Devise to use the default
# scope, setting true below.
# config.use_default_scope = true
# Configure the default scope used by Devise. By default it's the first devise
# role declared in your routes.
# config.default_scope = :user
# If you want to use other strategies, that are not (yet) supported by Devise,
# you can configure them inside the config.warden block. The example below
# allows you to setup OAuth, using http://github.com/roman/warden_oauth
#
# config.warden do |manager|
# manager.oauth(:twitter) do |twitter|
# twitter.consumer_secret = <YOUR CONSUMER SECRET>
# twitter.consumer_key = <YOUR CONSUMER KEY>
# twitter.options :site => 'http://twitter.com'
# end
# manager.default_strategies.unshift :twitter_oauth
# end
# Configure default_url_options if you are using dynamic segments in :path_prefix
# for devise_for.
# config.default_url_options do
# { :locale => I18n.locale }
# end
end

View File

@@ -1,3 +0,0 @@
To copy all session, password, confirmation and mailer views from devise to your app just run the following command:
script/generate devise_views

View File

@@ -1,21 +0,0 @@
class DeviseViewsGenerator < Rails::Generator::Base
def initialize(*args)
super
@source_root = options[:source] || File.join(spec.path, '..', '..')
end
def manifest
record do |m|
m.directory "app/views"
Dir[File.join(@source_root, "app", "views", "**/*.erb")].each do |file|
file = file.gsub(@source_root, "")[1..-1]
m.directory File.dirname(file)
m.file file, file
end
end
end
end

View File

@@ -0,0 +1,106 @@
# frozen_string_literal: true
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
# Activate the gem you are reporting the issue against.
gem 'rails', '~> 4.2.0'
gem 'devise', '~> 4.0'
gem 'sqlite3'
gem 'byebug'
end
require 'rack/test'
require 'action_controller/railtie'
require 'active_record'
require 'devise/rails/routes'
require 'devise/rails/warden_compat'
ActiveRecord::Base.establish_connection( adapter: :sqlite3, database: ':memory:')
class DeviseCreateUsers < ActiveRecord::Migration
def change
create_table(:users) do |t|
t.string :email, null: false
t.string :encrypted_password, null: true
t.timestamps null: false
end
end
end
Devise.setup do |config|
require 'devise/orm/active_record'
config.secret_key = 'secret_key_base'
end
class TestApp < Rails::Application
config.root = File.dirname(__FILE__)
config.session_store :cookie_store, key: 'cookie_store_key'
secrets.secret_token = 'secret_token'
secrets.secret_key_base = 'secret_key_base'
config.eager_load = false
config.middleware.use Warden::Manager do |config|
Devise.warden_config = config
end
config.logger = Logger.new($stdout)
Rails.logger = config.logger
end
Rails.application.initialize!
DeviseCreateUsers.migrate(:up)
class User < ActiveRecord::Base
devise :database_authenticatable
end
Rails.application.routes.draw do
devise_for :users
get '/' => 'test#index'
end
class ApplicationController < ActionController::Base
end
class TestController < ApplicationController
include Rails.application.routes.url_helpers
before_action :authenticate_user!
def index
render plain: 'Home'
end
end
require 'minitest/autorun'
class BugTest < ActionDispatch::IntegrationTest
include Rack::Test::Methods
include Warden::Test::Helpers
def test_returns_success
Warden.test_mode!
login_as User.create!(email: 'test@test.com', password: 'test123456', password_confirmation: 'test123456')
get '/'
assert last_response.ok?
end
private
def app
Rails.application
end
end

View File

@@ -1,2 +0,0 @@
# We need to load devise here to ensure routes extensions are loaded.
require 'devise'

View File

@@ -1,142 +1,207 @@
# frozen_string_literal: true
require 'rails'
require 'active_support/core_ext/numeric/time'
require 'active_support/dependencies'
require 'orm_adapter'
require 'set'
require 'securerandom'
require 'responders'
module Devise
autoload :FailureApp, 'devise/failure_app'
autoload :Schema, 'devise/schema'
autoload :TestHelpers, 'devise/test_helpers'
autoload :Delegator, 'devise/delegator'
autoload :Encryptor, 'devise/encryptor'
autoload :FailureApp, 'devise/failure_app'
autoload :OmniAuth, 'devise/omniauth'
autoload :Orm, 'devise/orm'
autoload :ParameterFilter, 'devise/parameter_filter'
autoload :ParameterSanitizer, 'devise/parameter_sanitizer'
autoload :TimeInflector, 'devise/time_inflector'
autoload :TokenGenerator, 'devise/token_generator'
module Controllers
autoload :Helpers, 'devise/controllers/helpers'
autoload :InternalHelpers, 'devise/controllers/internal_helpers'
autoload :UrlHelpers, 'devise/controllers/url_helpers'
autoload :Helpers, 'devise/controllers/helpers'
autoload :Rememberable, 'devise/controllers/rememberable'
autoload :Responder, 'devise/controllers/responder'
autoload :ScopedViews, 'devise/controllers/scoped_views'
autoload :SignInOut, 'devise/controllers/sign_in_out'
autoload :StoreLocation, 'devise/controllers/store_location'
autoload :UrlHelpers, 'devise/controllers/url_helpers'
end
module Encryptors
autoload :Base, 'devise/encryptors/base'
autoload :Bcrypt, 'devise/encryptors/bcrypt'
autoload :AuthlogicSha512, 'devise/encryptors/authlogic_sha512'
autoload :ClearanceSha1, 'devise/encryptors/clearance_sha1'
autoload :RestfulAuthenticationSha1, 'devise/encryptors/restful_authentication_sha1'
autoload :Sha512, 'devise/encryptors/sha512'
autoload :Sha1, 'devise/encryptors/sha1'
module Hooks
autoload :Proxy, 'devise/hooks/proxy'
end
module Orm
autoload :ActiveRecord, 'devise/orm/active_record'
autoload :DataMapper, 'devise/orm/data_mapper'
autoload :MongoMapper, 'devise/orm/mongo_mapper'
module Mailers
autoload :Helpers, 'devise/mailers/helpers'
end
ALL = []
module Strategies
autoload :Base, 'devise/strategies/base'
autoload :Authenticatable, 'devise/strategies/authenticatable'
end
# Authentication ones first
ALL.push :authenticatable, :http_authenticatable, :token_authenticatable, :rememberable
module Test
autoload :ControllerHelpers, 'devise/test/controller_helpers'
autoload :IntegrationHelpers, 'devise/test/integration_helpers'
end
# Misc after
ALL.push :recoverable, :registerable, :validatable
# Constants which holds devise configuration for extensions. Those should
# not be modified by the "end user" (this is why they are constants).
ALL = []
CONTROLLERS = {}
ROUTES = {}
STRATEGIES = {}
URL_HELPERS = {}
# The ones which can sign out after
ALL.push :activatable, :confirmable, :lockable, :timeoutable
# Strategies that do not require user input.
NO_INPUT = []
# Stats for last, so we make sure the user is really signed in
ALL.push :trackable
# True values used to check params
TRUE_VALUES = [true, 1, '1', 'on', 'ON', 't', 'T', 'true', 'TRUE']
# Maps controller names to devise modules.
CONTROLLERS = {
:sessions => [:authenticatable, :token_authenticatable],
:passwords => [:recoverable],
:confirmations => [:confirmable],
:registrations => [:registerable],
:unlocks => [:lockable]
}
# Secret key used by the key generator
mattr_accessor :secret_key
@@secret_key = nil
# Routes for generating url helpers.
ROUTES = [:session, :password, :confirmation, :registration, :unlock]
# Custom domain or key for cookies. Not set by default
mattr_accessor :rememberable_options
@@rememberable_options = {}
STRATEGIES = [:rememberable, :http_authenticatable, :token_authenticatable, :authenticatable]
TRUE_VALUES = [true, 1, '1', 't', 'T', 'true', 'TRUE']
# Maps the messages types that are used in flash message.
FLASH_MESSAGES = [:unauthenticated, :unconfirmed, :invalid, :invalid_token, :timeout, :inactive, :locked]
# Declare encryptors length which are used in migrations.
ENCRYPTORS_LENGTH = {
:sha1 => 40,
:sha512 => 128,
:clearance_sha1 => 40,
:restful_authentication_sha1 => 40,
:authlogic_sha512 => 128,
:bcrypt => 60
}
# Email regex used to validate email formats. Adapted from authlogic.
EMAIL_REGEX = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
# Used to encrypt password. Please generate one with rake secret.
mattr_accessor :pepper
@@pepper = nil
# The number of times to encrypt password.
# The number of times to hash the password.
mattr_accessor :stretches
@@stretches = 10
@@stretches = 12
# Keys used when authenticating an user.
# The default key used when authenticating over http auth.
mattr_accessor :http_authentication_key
@@http_authentication_key = nil
# Keys used when authenticating a user.
mattr_accessor :authentication_keys
@@authentication_keys = [ :email ]
@@authentication_keys = [:email]
# Time interval where the remember me token is valid.
# Request keys used when authenticating a user.
mattr_accessor :request_keys
@@request_keys = []
# Keys that should be case-insensitive.
mattr_accessor :case_insensitive_keys
@@case_insensitive_keys = [:email]
# Keys that should have whitespace stripped.
mattr_accessor :strip_whitespace_keys
@@strip_whitespace_keys = [:email]
# If http authentication is enabled by default.
mattr_accessor :http_authenticatable
@@http_authenticatable = false
# If http headers should be returned for ajax requests. True by default.
mattr_accessor :http_authenticatable_on_xhr
@@http_authenticatable_on_xhr = true
# If params authenticatable is enabled by default.
mattr_accessor :params_authenticatable
@@params_authenticatable = true
# The realm used in Http Basic Authentication.
mattr_accessor :http_authentication_realm
@@http_authentication_realm = "Application"
# Email regex used to validate email formats. It asserts that there are no
# @ symbols or whitespaces in either the localpart or the domain, and that
# there is a single @ symbol separating the localpart and the domain.
mattr_accessor :email_regexp
@@email_regexp = /\A[^@\s]+@[^@\s]+\z/
# Range validation for password length
mattr_accessor :password_length
@@password_length = 6..128
# The time the user will be remembered without asking for credentials again.
mattr_accessor :remember_for
@@remember_for = 2.weeks
# If true, extends the user's remember period when remembered via cookie.
mattr_accessor :extend_remember_period
@@extend_remember_period = false
# If true, all the remember me tokens are going to be invalidated when the user signs out.
mattr_accessor :expire_all_remember_me_on_sign_out
@@expire_all_remember_me_on_sign_out = true
# Time interval you can access your account before confirming your account.
# nil - allows unconfirmed access for unlimited time
mattr_accessor :allow_unconfirmed_access_for
@@allow_unconfirmed_access_for = 0.days
# Time interval the confirmation token is valid. nil = unlimited
mattr_accessor :confirm_within
@@confirm_within = 0.days
@@confirm_within = nil
# Defines which key will be used when confirming an account.
mattr_accessor :confirmation_keys
@@confirmation_keys = [:email]
# Defines if email should be reconfirmable.
mattr_accessor :reconfirmable
@@reconfirmable = true
# Time interval to timeout the user session without activity.
mattr_accessor :timeout_in
@@timeout_in = 30.minutes
# Used to define the password encryption algorithm.
mattr_accessor :encryptor
@@encryptor = :sha1
# Used to hash the password. Please generate one with rails secret.
mattr_accessor :pepper
@@pepper = nil
# Store scopes mappings.
mattr_accessor :mappings
@@mappings = ActiveSupport::OrderedHash.new
# Used to send notification to the original user email when their email is changed.
mattr_accessor :send_email_changed_notification
@@send_email_changed_notification = false
# Stores the chosen ORM.
mattr_accessor :orm
@@orm = :active_record
# TODO Remove
mattr_accessor :all
@@all = []
# Tells if devise should apply the schema in ORMs where devise declaration
# and schema belongs to the same class (as Datamapper and MongoMapper).
mattr_accessor :apply_schema
@@apply_schema = true
# Used to enable sending notification to user when their password is changed.
mattr_accessor :send_password_change_notification
@@send_password_change_notification = false
# Scoped views. Since it relies on fallbacks to render default views, it's
# turned off by default.
mattr_accessor :scoped_views
@@scoped_views = false
# Number of authentication tries before locking an account
mattr_accessor :maximum_attempts
@@maximum_attempts = 20
# Defines which strategy can be used to lock an account.
# Values: :failed_attempts, :none
mattr_accessor :lock_strategy
@@lock_strategy = :failed_attempts
# Defines which key will be used when locking and unlocking an account
mattr_accessor :unlock_keys
@@unlock_keys = [:email]
# Defines which strategy can be used to unlock an account.
# Values: :email, :time, :both
mattr_accessor :unlock_strategy
@@unlock_strategy = :both
# Number of authentication tries before locking an account
mattr_accessor :maximum_attempts
@@maximum_attempts = 20
# Time interval to unlock the account if :time is defined as unlock_strategy.
mattr_accessor :unlock_in
@@unlock_in = 1.hour
# Tell when to use the default scope, if one cannot be found from routes.
mattr_accessor :use_default_scope
@@use_default_scope = false
# Defines which key will be used when recovering the password for an account
mattr_accessor :reset_password_keys
@@reset_password_keys = [:email]
# Time interval you can reset your password with a reset password key
mattr_accessor :reset_password_within
@@reset_password_within = 6.hours
# When set to false, resetting a password does not automatically sign in a user
mattr_accessor :sign_in_after_reset_password
@@sign_in_after_reset_password = true
# The default scope which is used by warden.
mattr_accessor :default_scope
@@ -146,107 +211,323 @@ module Devise
mattr_accessor :mailer_sender
@@mailer_sender = nil
# Authentication token params key name of choice. E.g. /users/sign_in?some_key=...
mattr_accessor :token_authentication_key
@@token_authentication_key = :auth_token
# Skip session storage for the following strategies
mattr_accessor :skip_session_storage
@@skip_session_storage = [:http_auth]
# The realm used in Http Basic Authentication
mattr_accessor :http_authentication_realm
@@http_authentication_realm = "Application"
# Which formats should be treated as navigational.
mattr_accessor :navigational_formats
@@navigational_formats = ["*/*", :html, :turbo_stream]
class << self
# Default way to setup Devise. Run script/generate devise_install to create
# a fresh initializer with all configuration values.
def setup
yield self
# The default responder used by Devise, used to customize status codes with:
#
# `config.responder.error_status`
# `config.responder.redirect_status`
#
# Can be replaced by a custom application responder.
mattr_accessor :responder
@@responder = Devise::Controllers::Responder
# When set to true, signing out a user signs out all other scopes.
mattr_accessor :sign_out_all_scopes
@@sign_out_all_scopes = true
# The default method used while signing out
mattr_accessor :sign_out_via
@@sign_out_via = :delete
# The parent controller all Devise controllers inherits from.
# Defaults to ApplicationController. This should be set early
# in the initialization process and should be set to a string.
mattr_accessor :parent_controller
@@parent_controller = "ApplicationController"
# The parent mailer all Devise mailers inherit from.
# Defaults to ActionMailer::Base. This should be set early
# in the initialization process and should be set to a string.
mattr_accessor :parent_mailer
@@parent_mailer = "ActionMailer::Base"
# The router Devise should use to generate routes. Defaults
# to :main_app. Should be overridden by engines in order
# to provide custom routes.
mattr_accessor :router_name
@@router_name = nil
# Set the OmniAuth path prefix so it can be overridden when
# Devise is used in a mountable engine
mattr_accessor :omniauth_path_prefix
@@omniauth_path_prefix = nil
# Set if we should clean up the CSRF Token on authentication
mattr_accessor :clean_up_csrf_token_on_authentication
@@clean_up_csrf_token_on_authentication = true
# When false, Devise will not attempt to reload routes on eager load.
# This can reduce the time taken to boot the app but if your application
# requires the Devise mappings to be loaded during boot time the application
# won't boot properly.
mattr_accessor :reload_routes
@@reload_routes = true
# PRIVATE CONFIGURATION
# Store scopes mappings.
@@mappings = {}
def self.mappings
# 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.
Rails.application.try(:reload_routes_unless_loaded)
@@mappings
end
# OmniAuth configurations.
mattr_reader :omniauth_configs
@@omniauth_configs = {}
# Define a set of modules that are called when a mapping is added.
mattr_reader :helpers
@@helpers = Set.new
@@helpers << Devise::Controllers::Helpers
# Private methods to interface with Warden.
mattr_accessor :warden_config
@@warden_config = nil
@@warden_config_blocks = []
# When true, enter in paranoid mode to avoid user enumeration.
mattr_accessor :paranoid
@@paranoid = false
# When true, warn user if they just used next-to-last attempt of authentication
mattr_accessor :last_attempt_warning
@@last_attempt_warning = true
# Stores the token generator
mattr_accessor :token_generator
@@token_generator = nil
# When set to false, changing a password does not automatically sign in a user
mattr_accessor :sign_in_after_change_password
@@sign_in_after_change_password = true
# Default way to set up Devise. Run rails generate devise_install to create
# a fresh initializer with all configuration values.
def self.setup
yield self
end
class Getter
def initialize(name)
@name = name
end
# Sets warden configuration using a block that will be invoked on warden
# initialization.
#
# Devise.initialize do |config|
# config.confirm_within = 2.days
#
# config.warden do |manager|
# # Configure warden to use other strategies, like oauth.
# manager.oauth(:twitter)
# end
# end
def warden(&block)
@warden_config = block
def get
# TODO: Remove AS::Dependencies usage when dropping support to Rails < 7.
if ActiveSupport::Dependencies.respond_to?(:constantize)
ActiveSupport::Dependencies.constantize(@name)
else
@name.constantize
end
end
end
def self.ref(arg)
# TODO: Remove AS::Dependencies usage when dropping support to Rails < 7.
if ActiveSupport::Dependencies.respond_to?(:reference)
ActiveSupport::Dependencies.reference(arg)
end
Getter.new(arg)
end
def self.available_router_name
router_name || :main_app
end
def self.omniauth_providers
omniauth_configs.keys
end
# Get the mailer class from the mailer reference object.
def self.mailer
@@mailer_ref.get
end
# Set the mailer reference object to access the mailer.
def self.mailer=(class_name)
@@mailer_ref = ref(class_name)
end
self.mailer = "Devise::Mailer"
# Small method that adds a mapping to Devise.
def self.add_mapping(resource, options)
mapping = Devise::Mapping.new(resource, options)
@@mappings[mapping.name] = mapping
@@default_scope ||= mapping.name
@@helpers.each { |h| h.define_helpers(mapping) }
mapping
end
# Register available devise modules. For the standard modules that Devise provides, this method is
# called from lib/devise/modules.rb. Third-party modules need to be added explicitly using this method.
#
# Note that adding a module using this method does not cause it to be used in the authentication
# process. That requires that the module be listed in the arguments passed to the 'devise' method
# in the model class definition.
#
# == Options:
#
# +model+ - String representing the load path to a custom *model* for this module (to autoload.)
# +controller+ - Symbol representing the name of an existing or custom *controller* for this module.
# +route+ - Symbol representing the named *route* helper for this module.
# +strategy+ - Symbol representing if this module got a custom *strategy*.
# +insert_at+ - Integer representing the order in which this module's model will be included
#
# All values, except :model, accept also a boolean and will have the same name as the given module
# name.
#
# == Examples:
#
# Devise.add_module(:party_module)
# Devise.add_module(:party_module, strategy: true, controller: :sessions)
# Devise.add_module(:party_module, model: 'party_module/model')
# Devise.add_module(:party_module, insert_at: 0)
#
def self.add_module(module_name, options = {})
options.assert_valid_keys(:strategy, :model, :controller, :route, :no_input, :insert_at)
ALL.insert (options[:insert_at] || -1), module_name
if strategy = options[:strategy]
strategy = (strategy == true ? module_name : strategy)
STRATEGIES[module_name] = strategy
end
# Configure default url options to be used within Devise and ActionController.
def default_url_options(&block)
Devise::Mapping.metaclass.send :define_method, :default_url_options, &block
if controller = options[:controller]
controller = (controller == true ? module_name : controller)
CONTROLLERS[module_name] = controller
end
# A method used internally to setup warden manager from the Rails initialize
# block.
def configure_warden(config) #:nodoc:
config.default_strategies *Devise::STRATEGIES
config.failure_app = Devise::FailureApp
config.silence_missing_strategies!
config.default_scope = Devise.default_scope
NO_INPUT << strategy if options[:no_input]
# If the user provided a warden hook, call it now.
@warden_config.try :call, config
end
# The class of the configured ORM
def orm_class
Devise::Orm.const_get(@@orm.to_s.camelize.to_sym)
end
# Generate a friendly string randomically to be used as token.
def friendly_token
ActiveSupport::SecureRandom.base64(15).tr('+/=', '-_ ').strip.delete("\n")
end
# Make Devise aware of an 3rd party Devise-module. For convenience.
#
# == Options:
#
# +strategy+ - Boolean value representing if this module got a custom *strategy*.
# Default is +false+. Note: Devise will auto-detect this in such case if this is true.
# +model+ - String representing a load path to a custom *model* for this module (to autoload).
# Default is +nil+ (i.e. +false+).
# +controller+ - Symbol representing a name of an exisiting or custom *controller* for this module.
# Default is +nil+ (i.e. +false+).
#
# == Examples:
#
# Devise.add_module(:party_module)
# Devise.add_module(:party_module, :strategy => true, :controller => :sessions)
# Devise.add_module(:party_module, :model => 'party_module/model')
#
def add_module(module_name, options = {})
Devise::ALL.unshift module_name unless Devise::ALL.include?(module_name)
Devise::STRATEGIES.unshift module_name if options[:strategy] && !Devise::STRATEGIES.include?(module_name)
if options[:controller]
controller = options[:controller].to_sym
Devise::CONTROLLERS[controller] ||= []
Devise::CONTROLLERS[controller].unshift module_name unless Devise::CONTROLLERS[controller].include?(module_name)
if route = options[:route]
case route
when TrueClass
key, value = module_name, []
when Symbol
key, value = route, []
when Hash
key, value = route.keys.first, route.values.flatten
else
raise ArgumentError, ":route should be true, a Symbol or a Hash"
end
if options[:model]
Devise::Models.module_eval do
autoload :"#{module_name.to_s.classify}", options[:model]
URL_HELPERS[key] ||= []
URL_HELPERS[key].concat(value)
URL_HELPERS[key].uniq!
ROUTES[module_name] = key
end
if options[:model]
path = (options[:model] == true ? "devise/models/#{module_name}" : options[:model])
camelized = ActiveSupport::Inflector.camelize(module_name.to_s)
Devise::Models.send(:autoload, camelized.to_sym, path)
end
Devise::Mapping.add_module module_name
end
# Sets warden configuration using a block that will be invoked on warden
# initialization.
#
# Devise.setup do |config|
# config.allow_unconfirmed_access_for = 2.days
#
# config.warden do |warden_config|
# # Configure warden to use other strategies, like oauth.
# warden_config.oauth(:twitter)
# end
# end
def self.warden(&block)
@@warden_config_blocks << block
end
# Specify an OmniAuth provider.
#
# config.omniauth :github, APP_ID, APP_SECRET
#
def self.omniauth(provider, *args)
config = Devise::OmniAuth::Config.new(provider, args)
@@omniauth_configs[config.strategy_name.to_sym] = config
end
# Include helpers in the given scope to AC and AV.
def self.include_helpers(scope)
ActiveSupport.on_load(:action_controller) do
include scope::Helpers if defined?(scope::Helpers)
include scope::UrlHelpers
end
ActiveSupport.on_load(:action_view) do
include scope::UrlHelpers
end
end
# Regenerates url helpers considering Devise.mapping
def self.regenerate_helpers!
Devise::Controllers::UrlHelpers.remove_helpers!
Devise::Controllers::UrlHelpers.generate_helpers!
end
# A method used internally to complete the setup of warden manager after routes are loaded.
# See lib/devise/rails/routes.rb - ActionDispatch::Routing::RouteSet#finalize_with_devise!
def self.configure_warden! #:nodoc:
@@warden_configured ||= begin
warden_config.failure_app = Devise::Delegator.new
warden_config.default_scope = Devise.default_scope
warden_config.intercept_401 = false
Devise.mappings.each_value do |mapping|
warden_config.scope_defaults mapping.name, strategies: mapping.strategies
warden_config.serialize_into_session(mapping.name) do |record|
mapping.to.serialize_into_session(record)
end
warden_config.serialize_from_session(mapping.name) do |args|
mapping.to.serialize_from_session(*args)
end
end
Devise::Mapping.register module_name
@@warden_config_blocks.map { |block| block.call Devise.warden_config }
true
end
end
# Generate a friendly string randomly to be used as token.
# By default, length is 20 characters.
def self.friendly_token(length = 20)
# To calculate real characters, we must perform this operation.
# See SecureRandom.urlsafe_base64
rlength = (length * 3) / 4
SecureRandom.urlsafe_base64(rlength).tr('lIO0', 'sxyz')
end
# constant-time comparison algorithm to prevent timing attacks
def self.secure_compare(a, b)
return false if a.nil? || b.nil?
ActiveSupport::SecurityUtils.secure_compare(a, b)
end
def self.deprecator
@deprecator ||= ActiveSupport::Deprecation.new("5.0", "Devise")
end
end
begin
require 'warden'
rescue
gem 'warden'
require 'warden'
end
require 'warden'
require 'devise/mapping'
require 'devise/models'
require 'devise/modules'
require 'devise/rails'

View File

@@ -1,200 +1,295 @@
# frozen_string_literal: true
module Devise
module Controllers
# Those helpers are convenience methods added to ApplicationController.
module Helpers
extend ActiveSupport::Concern
include Devise::Controllers::SignInOut
include Devise::Controllers::StoreLocation
def self.included(base)
base.class_eval do
helper_method :warden, :signed_in?, :devise_controller?,
*Devise.mappings.keys.map { |m| [:"current_#{m}", :"#{m}_signed_in?"] }.flatten
# Use devise default_url_options. We have to declare it here to overwrite
# default definitions.
def default_url_options(options=nil)
Devise::Mapping.default_url_options
end
included do
if respond_to?(:helper_method)
helper_method :warden, :signed_in?, :devise_controller?
end
end
# The main accessor for the warden proxy instance
def warden
request.env['warden']
end
module ClassMethods
# Define authentication filters and accessor helpers for a group of mappings.
# These methods are useful when you are working with multiple mappings that
# share some functionality. They are pretty much the same as the ones
# defined for normal mappings.
#
# Example:
#
# inside BlogsController (or any other controller, it doesn't matter which):
# devise_group :blogger, contains: [:user, :admin]
#
# Generated methods:
# authenticate_blogger! # Redirects unless user or admin are signed in
# blogger_signed_in? # Checks whether there is either a user or an admin signed in
# current_blogger # Currently signed in user or admin
# current_bloggers # Currently signed in user and admin
#
# Use:
# before_action :authenticate_blogger! # Redirects unless either a user or an admin are authenticated
# 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 = {})
mappings = "[#{ opts[:contains].map { |m| ":#{m}" }.join(',') }]"
# Return true if it's a devise_controller. false to all controllers unless
# the controllers defined inside devise. Useful if you want to apply a before
# filter to all controller, except the ones in devise:
#
# before_filter :my_filter, :unless => { |c| c.devise_controller? }
def devise_controller?
false
end
class_eval <<-METHODS, __FILE__, __LINE__ + 1
def authenticate_#{group_name}!(favorite = nil, opts = {})
unless #{group_name}_signed_in?
mappings = #{mappings}
mappings.unshift mappings.delete(favorite.to_sym) if favorite
mappings.each do |mapping|
opts[:scope] = mapping
opts[:locale] = I18n.locale
warden.authenticate!(opts) if !devise_controller? || opts.delete(:force)
end
end
end
# Attempts to authenticate the given scope by running authentication hooks,
# but does not redirect in case of failures.
def authenticate(scope)
warden.authenticate(:scope => scope)
end
def #{group_name}_signed_in?
#{mappings}.any? do |mapping|
warden.authenticate?(scope: mapping)
end
end
# Attempts to authenticate the given scope by running authentication hooks,
# redirecting in case of failures.
def authenticate!(scope)
warden.authenticate!(:scope => scope)
end
def current_#{group_name}(favorite = nil)
mappings = #{mappings}
mappings.unshift mappings.delete(favorite.to_sym) if favorite
mappings.each do |mapping|
current = warden.authenticate(scope: mapping)
return current if current
end
nil
end
# Check if the given scope is signed in session, without running
# authentication hooks.
def signed_in?(scope)
warden.authenticate?(:scope => scope)
end
def current_#{group_name.to_s.pluralize}
#{mappings}.map do |mapping|
warden.authenticate(scope: mapping)
end.compact
end
# Sign in an user that already was authenticated. This helper is useful for logging
# users in after sign up.
#
# Examples:
#
# sign_in :user, @user # sign_in(scope, resource)
# sign_in @user # sign_in(resource)
#
def sign_in(resource_or_scope, resource=nil)
scope = Devise::Mapping.find_scope!(resource_or_scope)
resource ||= resource_or_scope
warden.set_user(resource, :scope => scope)
end
if respond_to?(:helper_method)
helper_method "current_#{group_name}", "current_#{group_name.to_s.pluralize}", "#{group_name}_signed_in?"
end
METHODS
end
# Sign out a given user or scope. This helper is useful for signing out an user
# after deleting accounts.
#
# Examples:
#
# sign_out :user # sign_out(scope)
# sign_out @user # sign_out(resource)
#
def sign_out(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
warden.user(scope) # Without loading user here, before_logout hook is not called
warden.raw_session.inspect # Without this inspect here. The session does not clear.
warden.logout(scope)
end
# Returns and delete the url stored in the session for the given scope. Useful
# for giving redirect backs after sign up:
#
# Example:
#
# redirect_to stored_location_for(:user) || root_path
#
def stored_location_for(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
session.delete(:"#{scope}.return_to")
end
# The default url to be used after signing in. This is used by all Devise
# controllers and you can overwrite it in your ApplicationController to
# provide a custom hook for a custom resource.
#
# By default, it first tries to find a resource_root_path, otherwise it
# uses the root path. For a user scope, you can define the default url in
# the following way:
#
# map.user_root '/users', :controller => 'users' # creates user_root_path
#
# map.resources :users do |users|
# users.root # creates user_root_path
# end
#
#
# If none of these are defined, root_path is used. However, if this default
# is not enough, you can customize it, for example:
#
# def after_sign_in_path_for(resource)
# if resource.is_a?(User) && resource.can_publish?
# publisher_url
# else
# super
# end
# end
#
def after_sign_in_path_for(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
home_path = :"#{scope}_root_path"
respond_to?(home_path, true) ? send(home_path) : root_path
end
# Method used by sessions controller to sign out an user. You can overwrite
# it in your ApplicationController to provide a custom hook for a custom
# scope. Notice that differently from +after_sign_in_path_for+ this method
# receives a symbol with the scope, and not the resource.
#
# By default is the root_path.
def after_sign_out_path_for(resource_or_scope)
root_path
end
# Sign in an user and tries to redirect first to the stored location and
# then to the url specified by after_sign_in_path_for.
#
# If just a symbol is given, consider that the user was already signed in
# through other means and just perform the redirection.
def sign_in_and_redirect(resource_or_scope, resource=nil, skip=false)
scope = Devise::Mapping.find_scope!(resource_or_scope)
resource ||= resource_or_scope
sign_in(scope, resource) unless skip
redirect_to stored_location_for(scope) || after_sign_in_path_for(resource)
end
# Sign out an user and tries to redirect to the url specified by
# after_sign_out_path_for.
def sign_out_and_redirect(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
sign_out(scope)
redirect_to after_sign_out_path_for(scope)
def log_process_action(payload)
payload[:status] ||= 401 unless payload[:exception]
super
end
end
# Define authentication filters and accessor helpers based on mappings.
# These filters should be used inside the controllers as before_filters,
# These filters should be used inside the controllers as before_actions,
# so you can control the scope of the user who should be signed in to
# access that specific controller/action.
# Example:
#
# Maps:
# User => :authenticatable
# Admin => :authenticatable
# Roles:
# User
# Admin
#
# Generated methods:
# authenticate_user! # Signs user in or redirect
# authenticate_admin! # Signs admin in or redirect
# user_signed_in? # Checks whether there is an user signed in or not
# user_signed_in? # Checks whether there is a user signed in or not
# admin_signed_in? # Checks whether there is an admin signed in or not
# current_user # Current signed in user
# current_admin # Currend signed in admin
# current_admin # Current signed in admin
# user_session # Session data available only to the user scope
# admin_session # Session data available only to the admin scope
#
# Use:
# before_filter :authenticate_user! # Tell devise to use :user map
# before_filter :authenticate_admin! # Tell devise to use :admin map
# before_action :authenticate_user! # Tell devise to use :user map
# before_action :authenticate_admin! # Tell devise to use :admin map
#
Devise.mappings.each_key do |mapping|
def self.define_helpers(mapping) #:nodoc:
mapping = mapping.name
class_eval <<-METHODS, __FILE__, __LINE__ + 1
def authenticate_#{mapping}!
warden.authenticate!(:scope => :#{mapping})
def authenticate_#{mapping}!(opts = {})
opts[:scope] = :#{mapping}
opts[:locale] = I18n.locale
warden.authenticate!(opts) if !devise_controller? || opts.delete(:force)
end
def #{mapping}_signed_in?
warden.authenticate?(:scope => :#{mapping})
!!current_#{mapping}
end
def current_#{mapping}
@current_#{mapping} ||= warden.authenticate(:scope => :#{mapping})
@current_#{mapping} ||= warden.authenticate(scope: :#{mapping})
end
def #{mapping}_session
current_#{mapping} && warden.session(:#{mapping})
end
METHODS
ActiveSupport.on_load(:action_controller) do
if respond_to?(:helper_method)
helper_method "current_#{mapping}", "#{mapping}_signed_in?", "#{mapping}_session"
end
end
end
# The main accessor for the warden proxy instance
def warden
request.env['warden'] or raise MissingWarden
end
# Return true if it's a devise_controller. false to all controllers unless
# the controllers defined inside devise. Useful if you want to apply a before
# filter to all controllers, except the ones in devise:
#
# before_action :my_filter, unless: :devise_controller?
def devise_controller?
is_a?(::DeviseController)
end
# Set up a param sanitizer to filter parameters using strong_parameters. See
# lib/devise/parameter_sanitizer.rb for more info. Override this
# method in your application controller to use your own parameter sanitizer.
def devise_parameter_sanitizer
@devise_parameter_sanitizer ||= Devise::ParameterSanitizer.new(resource_class, resource_name, params)
end
# Tell warden that params authentication is allowed for that specific page.
def allow_params_authentication!
request.env["devise.allow_params_authentication"] = true
end
# The scope root url to be used when they're signed in. By default, it first
# tries to find a resource_root_path, otherwise it uses the root_path.
def signed_in_root_path(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
router_name = Devise.mappings[scope].router_name
home_path = "#{scope}_root_path"
context = router_name ? send(router_name) : self
if context.respond_to?(home_path, true)
context.send(home_path)
elsif context.respond_to?(:root_path)
context.root_path
elsif respond_to?(:root_path)
root_path
else
"/"
end
end
# The default url to be used after signing in. This is used by all Devise
# controllers and you can overwrite it in your ApplicationController to
# provide a custom hook for a custom resource.
#
# By default, it first tries to find a valid resource_return_to key in the
# session, then it fallbacks to resource_root_path, otherwise it uses the
# root path. For a user scope, you can define the default url in
# the following way:
#
# get '/users' => 'users#index', as: :user_root # creates user_root_path
#
# namespace :user do
# root 'users#index' # creates user_root_path
# end
#
# If the resource root path is not defined, root_path is used. However,
# if this default is not enough, you can customize it, for example:
#
# def after_sign_in_path_for(resource)
# stored_location_for(resource) ||
# if resource.is_a?(User) && resource.can_publish?
# publisher_url
# else
# super
# end
# end
#
def after_sign_in_path_for(resource_or_scope)
stored_location_for(resource_or_scope) || signed_in_root_path(resource_or_scope)
end
# Method used by sessions controller to sign out a user. You can overwrite
# it in your ApplicationController to provide a custom hook for a custom
# scope. Notice that differently from +after_sign_in_path_for+ this method
# receives a symbol with the scope, and not the resource.
#
# By default it is the root_path.
def after_sign_out_path_for(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
router_name = Devise.mappings[scope].router_name
context = router_name ? send(router_name) : self
context.respond_to?(:root_path) ? context.root_path : "/"
end
# Sign in a user and tries to redirect first to the stored location and
# then to the url specified by after_sign_in_path_for. It accepts the same
# parameters as the sign_in method.
def sign_in_and_redirect(resource_or_scope, *args)
options = args.extract_options!
scope = Devise::Mapping.find_scope!(resource_or_scope)
resource = args.last || resource_or_scope
sign_in(scope, resource, options)
redirect_to after_sign_in_path_for(resource)
end
# Sign out a user and tries to redirect to the url specified by
# after_sign_out_path_for.
def sign_out_and_redirect(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
redirect_path = after_sign_out_path_for(scope)
Devise.sign_out_all_scopes ? sign_out : sign_out(scope)
redirect_to redirect_path
end
# 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 behavior which resets/nullifies/raises
request.env["devise.skip_storage"] = true
sign_out_all_scopes(false)
end
def request_format
@request_format ||= request.format.try(:ref)
end
def is_navigational_format?
Devise.navigational_formats.include?(request_format)
end
# Check if flash messages should be emitted. Default is to do it on
# navigational formats
def is_flashing_format?
request.respond_to?(:flash) && is_navigational_format?
end
private
def expire_data_after_sign_out!
Devise.mappings.each { |_,m| instance_variable_set("@current_#{m.name}", nil) }
super
end
end
end
class MissingWarden < StandardError
def initialize
super "Devise could not find the `Warden::Proxy` instance on your request environment.\n" + \
"Make sure that your application is loading Devise and Warden as expected and that " + \
"the `Warden::Manager` middleware is present in your middleware stack.\n" + \
"If you are seeing this on one of your tests, ensure that your tests are either " + \
"executing the Rails middleware stack or that your tests are using the `Devise::Test::ControllerHelpers` " + \
"module to inject the `request.env['warden']` object for you."
end
end
end

View File

@@ -1,129 +0,0 @@
module Devise
module Controllers
# Those helpers are used only inside Devise controllers and should not be
# included in ApplicationController since they all depend on the url being
# accessed.
module InternalHelpers #:nodoc:
def self.included(base)
base.class_eval do
extend ScopedViews
unloadable
helper_method :resource, :scope_name, :resource_name, :resource_class, :devise_mapping, :devise_controller?
hide_action :resource, :scope_name, :resource_name, :resource_class, :devise_mapping, :devise_controller?
skip_before_filter *Devise.mappings.keys.map { |m| :"authenticate_#{m}!" }
before_filter :is_devise_resource?
end
end
module ScopedViews
def scoped_views
defined?(@scoped_views) ? @scoped_views : Devise.scoped_views
end
def scoped_views=(value)
@scoped_views = value
end
end
# Gets the actual resource stored in the instance variable
def resource
instance_variable_get(:"@#{resource_name}")
end
# Proxy to devise map name
def resource_name
devise_mapping.name
end
alias :scope_name :resource_name
# Proxy to devise map class
def resource_class
devise_mapping.to
end
# Attempt to find the mapped route for devise based on request path
def devise_mapping
@devise_mapping ||= begin
mapping = Devise::Mapping.find_by_path(request.path)
mapping ||= Devise.mappings[Devise.default_scope] if Devise.use_default_scope
mapping
end
end
# Overwrites devise_controller? to return true
def devise_controller?
true
end
protected
# Checks whether it's a devise mapped resource or not.
def is_devise_resource? #:nodoc:
raise ActionController::UnknownAction unless devise_mapping && devise_mapping.allows?(controller_name)
end
# Sets the resource creating an instance variable
def resource=(new_resource)
instance_variable_set(:"@#{resource_name}", new_resource)
end
# Build a devise resource.
def build_resource
self.resource ||= resource_class.new(params[resource_name] || {})
end
# Helper for use in before_filters where no authentication is required.
#
# Example:
# before_filter :require_no_authentication, :only => :new
def require_no_authentication
redirect_to after_sign_in_path_for(resource_name) if warden.authenticated?(resource_name)
end
# Sets the flash message with :key, using I18n. By default you are able
# to setup your messages using specific resource scope, and if no one is
# found we look to default scope.
# Example (i18n locale file):
#
# en:
# devise:
# passwords:
# #default_scope_messages - only if resource_scope is not found
# user:
# #resource_scope_messages
#
# Please refer to README or en.yml locale file to check what messages are
# available.
def set_flash_message(key, kind, now=false)
flash_hash = now ? flash.now : flash
flash_hash[key] = I18n.t(:"#{resource_name}.#{kind}",
:scope => [:devise, controller_name.to_sym], :default => kind)
end
# Shortcut to set flash.now message. Same rules applied from set_flash_message
def set_now_flash_message(key, kind)
set_flash_message(key, kind, true)
end
# Render a view for the specified scope. Turned off by default.
# Accepts just :controller as option.
def render_with_scope(action, options={})
controller_name = options.delete(:controller) || self.controller_name
if self.class.scoped_views
begin
render :template => "#{controller_name}/#{devise_mapping.as}/#{action}"
rescue ActionView::MissingTemplate
render action, :controller => controller_name
end
else
render action, :controller => controller_name
end
end
end
end
end

View File

@@ -0,0 +1,56 @@
# frozen_string_literal: true
module Devise
module Controllers
# A module that may be optionally included in a controller in order
# to provide remember me behavior. Useful when signing in is done
# through a callback, like in OmniAuth.
module Rememberable
# Return default cookie values retrieved from session options.
def self.cookie_values
Rails.configuration.session_options.slice(:path, :domain, :secure)
end
def remember_me_is_active?(resource)
return false unless resource.respond_to?(:remember_me)
scope = Devise::Mapping.find_scope!(resource)
_, token, generated_at = cookies.signed[remember_key(resource, scope)]
resource.remember_me?(token, generated_at)
end
# Remembers the given resource by setting up a cookie
def remember_me(resource)
return if request.env["devise.skip_storage"]
scope = Devise::Mapping.find_scope!(resource)
resource.remember_me!
cookies.signed[remember_key(resource, scope)] = remember_cookie_values(resource)
end
# Forgets the given resource by deleting a cookie
def forget_me(resource)
scope = Devise::Mapping.find_scope!(resource)
resource.forget_me!
cookies.delete(remember_key(resource, scope), forget_cookie_values(resource))
end
protected
def forget_cookie_values(resource)
Devise::Controllers::Rememberable.cookie_values.merge!(resource.rememberable_options)
end
def remember_cookie_values(resource)
options = { httponly: true }
options.merge!(forget_cookie_values(resource))
options.merge!(
value: resource.class.serialize_into_cookie(resource),
expires: resource.remember_expires_at
)
end
def remember_key(resource, scope)
resource.rememberable_options.fetch(:key, "remember_#{scope}_token")
end
end
end
end

View File

@@ -0,0 +1,35 @@
# frozen_string_literal: true
module Devise
module Controllers
# Custom Responder to configure default statuses that only apply to Devise,
# and allow to integrate more easily with Hotwire/Turbo.
class Responder < ActionController::Responder
if respond_to?(:error_status=) && respond_to?(:redirect_status=)
self.error_status = :ok
self.redirect_status = :found
else
# TODO: remove this support for older Rails versions, which aren't supported by Turbo
# and/or responders. It won't allow configuring a custom response, but it allows Devise
# to use these methods and defaults across the implementation more easily.
def self.error_status
:ok
end
def self.redirect_status
:found
end
def self.error_status=(*)
warn "[DEVISE] Setting the error status on the Devise responder has no effect with this " \
"version of `responders`, please make sure you're using a newer version. Check the changelog for more info."
end
def self.redirect_status=(*)
warn "[DEVISE] Setting the redirect status on the Devise responder has no effect with this " \
"version of `responders`, please make sure you're using a newer version. Check the changelog for more info."
end
end
end
end
end

View File

@@ -0,0 +1,19 @@
# frozen_string_literal: true
module Devise
module Controllers
module ScopedViews
extend ActiveSupport::Concern
module ClassMethods
def scoped_views?
defined?(@scoped_views) ? @scoped_views : Devise.scoped_views
end
def scoped_views=(value)
@scoped_views = value
end
end
end
end
end

View File

@@ -0,0 +1,106 @@
# frozen_string_literal: true
module Devise
module Controllers
# Provide sign in and sign out functionality.
# Included by default in all controllers.
module SignInOut
# Return true if the given scope is signed in session. If no scope given, return
# true if any scope is signed in. This will run authentication hooks, which may
# 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)
[scope || Devise.mappings.keys].flatten.any? do |_scope|
warden.authenticate?(scope: _scope)
end
end
# Sign in a user that already was authenticated. This helper is useful for logging
# users in after sign up. All options given to sign_in is passed forward
# 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/heartcombo/devise/blob/main/app/controllers/devise/sessions_controller.rb#L7
#
# Examples:
#
# sign_in :user, @user # sign_in(scope, resource)
# sign_in @user # sign_in(resource)
# sign_in @user, event: :authentication # sign_in(resource, options)
# sign_in @user, store: false # sign_in(resource, options)
#
def sign_in(resource_or_scope, *args)
options = args.extract_options!
scope = Devise::Mapping.find_scope!(resource_or_scope)
resource = args.last || resource_or_scope
expire_data_after_sign_in!
if warden.user(scope) == resource && !options.delete(:force)
# Do nothing. User already signed in and we are not forcing it.
true
else
warden.set_user(resource, options.merge!(scope: scope))
end
end
# Sign in a user bypassing the warden callbacks and stores the user
# straight in session. This option is useful in cases the user is already
# signed in, but we want to refresh the credentials in session.
#
# Examples:
#
# bypass_sign_in @user, scope: :user
# bypass_sign_in @user
def bypass_sign_in(resource, scope: nil)
scope ||= Devise::Mapping.find_scope!(resource)
expire_data_after_sign_in!
warden.session_serializer.store(resource, scope)
end
# Sign out a given user or scope. This helper is useful for signing out a user
# after deleting accounts. Returns true if there was a logout and false if there
# is no user logged in on the referred scope
#
# Examples:
#
# sign_out :user # sign_out(scope)
# sign_out @user # sign_out(resource)
#
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
warden.logout(scope)
warden.clear_strategies_cache!(scope: scope)
instance_variable_set(:"@current_#{scope}", nil)
!!user
end
# 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)
users = Devise.mappings.keys.map { |s| warden.user(scope: s, run_callbacks: false) }
warden.logout
expire_data_after_sign_out!
warden.clear_strategies_cache!
warden.lock! if lock
users.any?
end
private
def expire_data_after_sign_in!
session.keys.grep(/^devise\./).each { |k| session.delete(k) }
end
alias :expire_data_after_sign_out! :expire_data_after_sign_in!
end
end
end

View File

@@ -0,0 +1,76 @@
# frozen_string_literal: true
require "uri"
module Devise
module Controllers
# Provide the ability to store a location.
# Used to redirect back to a desired path after sign in.
# Included by default in all controllers.
module StoreLocation
# Returns and delete (if it's navigational format) the url stored in the session for
# the given scope. Useful for giving redirect backs after sign up:
#
# Example:
#
# redirect_to stored_location_for(:user) || root_path
#
def stored_location_for(resource_or_scope)
session_key = stored_location_key_for(resource_or_scope)
if is_navigational_format?
session.delete(session_key)
else
session[session_key]
end
end
# Stores the provided location to redirect the user after signing in.
# Useful in combination with the `stored_location_for` helper.
#
# Example:
#
# store_location_for(:user, dashboard_path)
# redirect_to user_facebook_omniauth_authorize_path
#
def store_location_for(resource_or_scope, location)
session_key = stored_location_key_for(resource_or_scope)
path = extract_path_from_location(location)
session[session_key] = path if path
end
private
def parse_uri(location)
location && URI.parse(location)
rescue URI::InvalidURIError
nil
end
def stored_location_key_for(resource_or_scope)
scope = Devise::Mapping.find_scope!(resource_or_scope)
"#{scope}_return_to"
end
def extract_path_from_location(location)
uri = parse_uri(location)
if uri
path = remove_domain_from_uri(uri)
path = add_fragment_back_to_path(uri, path)
path
end
end
def remove_domain_from_uri(uri)
[uri.path.sub(/\A\/+/, '/'), uri.query].compact.join('?')
end
def add_fragment_back_to_path(uri, path)
[path, uri.fragment].compact.join('#')
end
end
end
end

View File

@@ -1,3 +1,5 @@
# frozen_string_literal: true
module Devise
module Controllers
# Create url helpers to be used with resource/scope configuration. Acts as
@@ -16,26 +18,52 @@ module Devise
# new_confirmation_path(:user) => new_user_confirmation_path
# confirmation_path(:user) => user_confirmation_path
#
# Those helpers are added to your ApplicationController.
# Those helpers are included by default to ActionController::Base.
#
# In case you want to add such helpers to another class, you can do
# that as long as this new class includes both url_helpers and
# mounted_helpers. Example:
#
# include Rails.application.routes.url_helpers
# include Rails.application.routes.mounted_helpers
#
module UrlHelpers
def self.remove_helpers!
self.instance_methods.map(&:to_s).grep(/_(url|path)$/).each do |method|
remove_method method
end
end
Devise::ROUTES.each do |module_name|
[:path, :url].each do |path_or_url|
actions = [ nil, :new_ ]
actions << :edit_ if [:password, :registration].include?(module_name)
actions << :destroy_ if [:session].include?(module_name)
def self.generate_helpers!(routes = nil)
routes ||= begin
mappings = Devise.mappings.values.map(&:used_helpers).flatten.uniq
Devise::URL_HELPERS.slice(*mappings)
end
actions.each do |action|
class_eval <<-URL_HELPERS, __FILE__, __LINE__ + 1
def #{action}#{module_name}_#{path_or_url}(resource_or_scope, *args)
routes.each do |module_name, actions|
[:path, :url].each do |path_or_url|
actions.each do |action|
action = action ? "#{action}_" : ""
method = :"#{action}#{module_name}_#{path_or_url}"
define_method method do |resource_or_scope, *args|
scope = Devise::Mapping.find_scope!(resource_or_scope)
send("#{action}\#{scope}_#{module_name}_#{path_or_url}", *args)
router_name = Devise.mappings[scope].router_name
context = router_name ? send(router_name) : _devise_route_context
context.send("#{action}#{scope}_#{module_name}_#{path_or_url}", *args)
end
URL_HELPERS
end
end
end
end
generate_helpers!(Devise::URL_HELPERS)
private
def _devise_route_context
@_devise_route_context ||= send(Devise.available_router_name)
end
end
end
end

18
lib/devise/delegator.rb Normal file
View File

@@ -0,0 +1,18 @@
# frozen_string_literal: true
module Devise
# Checks the scope in the given environment and returns the associated failure app.
class Delegator
def call(env)
failure_app(env).call(env)
end
def failure_app(env)
app = env["warden.options"] &&
(scope = env["warden.options"][:scope]) &&
Devise.mappings[scope.to_sym].failure_app
app || Devise::FailureApp
end
end
end

24
lib/devise/encryptor.rb Normal file
View File

@@ -0,0 +1,24 @@
# frozen_string_literal: true
require 'bcrypt'
module Devise
module Encryptor
def self.digest(klass, password)
if klass.pepper.present?
password = "#{password}#{klass.pepper}"
end
::BCrypt::Password.create(password, cost: klass.stretches).to_s
end
def self.compare(klass, hashed_password, password)
return false if hashed_password.blank?
bcrypt = ::BCrypt::Password.new(hashed_password)
if klass.pepper.present?
password = "#{password}#{klass.pepper}"
end
password = ::BCrypt::Engine.hash_secret(password, bcrypt.salt)
Devise.secure_compare(password, hashed_password)
end
end
end

View File

@@ -1,21 +0,0 @@
require "digest/sha2"
module Devise
module Encryptors
# = AuthlogicSha512
# Simulates Authlogic's default encryption mechanism.
# Warning: it uses Devise's stretches configuration to port Authlogic's one. Should be set to 20 in the initializer to silumate
# the default behavior.
class AuthlogicSha512 < Base
# Gererates a default password digest based on salt, pepper and the
# incoming password.
def self.digest(password, stretches, salt, pepper)
digest = [password, salt].flatten.join('')
stretches.times { digest = Digest::SHA512.hexdigest(digest) }
digest
end
end
end
end

View File

@@ -1,20 +0,0 @@
module Devise
# Implements a way of adding different encryptions.
# The class should implement a self.digest method that taks the following params:
# - password
# - stretches: the number of times the encryption will be applied
# - salt: the password salt as defined by devise
# - pepper: Devise config option
#
module Encryptors
class Base
def self.digest
raise NotImplemented
end
def self.salt
Devise.friendly_token
end
end
end
end

View File

@@ -1,21 +0,0 @@
require "bcrypt"
module Devise
module Encryptors
# = BCrypt
# Uses the BCrypt hash algorithm to encrypt passwords.
class Bcrypt < Base
# Gererates a default password digest based on stretches, salt, pepper and the
# incoming password. We don't strech it ourselves since BCrypt does so internally.
def self.digest(password, stretches, salt, pepper)
::BCrypt::Engine.hash_secret([password, pepper].join, salt, stretches)
end
def self.salt
::BCrypt::Engine.generate_salt
end
end
end
end

View File

@@ -1,19 +0,0 @@
require "digest/sha1"
module Devise
module Encryptors
# = ClearanceSha1
# Simulates Clearance's default encryption mechanism.
# Warning: it uses Devise's pepper to port the concept of REST_AUTH_SITE_KEY
# Warning: it uses Devise's stretches configuration to port the concept of REST_AUTH_DIGEST_STRETCHES
class ClearanceSha1 < Base
# Gererates a default password digest based on salt, pepper and the
# incoming password.
def self.digest(password, stretches, salt, pepper)
Digest::SHA1.hexdigest("--#{salt}--#{password}--")
end
end
end
end

View File

@@ -1,22 +0,0 @@
require "digest/sha1"
module Devise
module Encryptors
# = RestfulAuthenticationSha1
# Simulates Restful Authentication's default encryption mechanism.
# Warning: it uses Devise's pepper to port the concept of REST_AUTH_SITE_KEY
# Warning: it uses Devise's stretches configuration to port the concept of REST_AUTH_DIGEST_STRETCHES. Should be set to 10 in
# the initializer to silumate the default behavior.
class RestfulAuthenticationSha1 < Base
# Gererates a default password digest based on salt, pepper and the
# incoming password.
def self.digest(password, stretches, salt, pepper)
digest = pepper
stretches.times { digest = Digest::SHA1.hexdigest([digest, salt, password, pepper].flatten.join('--')) }
digest
end
end
end
end

View File

@@ -1,27 +0,0 @@
require "digest/sha1"
module Devise
module Encryptors
# = Sha1
# Uses the Sha1 hash algorithm to encrypt passwords.
class Sha1 < Base
# Gererates a default password digest based on stretches, salt, pepper and the
# incoming password.
def self.digest(password, stretches, salt, pepper)
digest = pepper
stretches.times { digest = self.secure_digest(salt, digest, password, pepper) }
digest
end
private
# Generate a SHA1 digest joining args. Generated token is something like
# --arg1--arg2--arg3--argN--
def self.secure_digest(*tokens)
::Digest::SHA1.hexdigest('--' << tokens.flatten.join('--') << '--')
end
end
end
end

View File

@@ -1,27 +0,0 @@
require "digest/sha2"
module Devise
module Encryptors
# = Sha512
# Uses the Sha512 hash algorithm to encrypt passwords.
class Sha512 < Base
# Gererates a default password digest based on salt, pepper and the
# incoming password.
def self.digest(password, stretches, salt, pepper)
digest = pepper
stretches.times { digest = self.secure_digest(salt, digest, password, pepper) }
digest
end
private
# Generate a Sha512 digest joining args. Generated token is something like
# --arg1--arg2--arg3--argN--
def self.secure_digest(*tokens)
::Digest::SHA512.hexdigest('--' << tokens.flatten.join('--') << '--')
end
end
end
end

View File

@@ -1,65 +1,285 @@
# frozen_string_literal: true
require "action_controller/metal"
module Devise
# Failure application that will be called every time :warden is thrown from
# any strategy or hook. Responsible for redirect the user to the sign in
# page based on current scope and mapping. If no scope is given, redirect
# to the default_url.
class FailureApp
attr_reader :env
include Warden::Mixins::Common
# any strategy or hook. It is responsible for redirecting the user to the sign
# in page based on current scope and mapping. If no scope is given, it
# redirects to the default_url.
class FailureApp < ActionController::Metal
include ActionController::UrlFor
include ActionController::Redirecting
cattr_accessor :default_url, :default_message, :instance_writer => false
@@default_message = :unauthenticated
include Rails.application.routes.url_helpers
include Rails.application.routes.mounted_helpers
include Devise::Controllers::StoreLocation
delegate :flash, to: :request
include AbstractController::Callbacks
around_action do |failure_app, action|
I18n.with_locale(failure_app.i18n_locale, &action)
end
def self.call(env)
new(env).respond!
@respond ||= action(:respond)
@respond.call(env)
end
def initialize(env)
@env = env
end
def respond!
options = @env['warden.options']
scope = options[:scope]
redirect_path = if mapping = Devise.mappings[scope]
"#{mapping.parsed_path}/#{mapping.path_names[:sign_in]}"
# Try retrieving the URL options from the parent controller (usually
# ApplicationController). Instance methods are not supported at the moment,
# so only the class-level attribute is used.
def self.default_url_options(*args)
if defined?(Devise.parent_controller.constantize)
Devise.parent_controller.constantize.try(:default_url_options) || {}
else
"/#{default_url}"
{}
end
query_string = query_string_for(options)
store_location!(scope)
headers = {}
headers["Location"] = redirect_path
headers["Location"] << "?" << query_string unless query_string.empty?
headers["Content-Type"] = 'text/plain'
[302, headers, ["You are being redirected to #{redirect_path}"]]
end
# Build the proper query string based on the given message.
def query_string_for(options)
message = @env['warden'].try(:message) || options[:message] || default_message
def respond
if http_auth?
http_auth
elsif warden_options[:recall]
recall
else
redirect
end
end
params = case message
when Symbol
{ message => true }
when String
{ :message => message }
def http_auth
self.status = 401
self.headers["WWW-Authenticate"] = %(Basic realm=#{Devise.http_authentication_realm.inspect}) if http_auth_header?
self.content_type = request.format.to_s
self.response_body = http_auth_body
end
def recall
header_info = if relative_url_root?
base_path = Pathname.new(relative_url_root)
full_path = Pathname.new(attempted_path)
{ "SCRIPT_NAME" => relative_url_root,
"PATH_INFO" => '/' + full_path.relative_path_from(base_path).to_s }
else
{ "PATH_INFO" => attempted_path }
end
header_info.each do | var, value|
if request.respond_to?(:set_header)
request.set_header(var, value)
else
{}
request.env[var] = value
end
end
Rack::Utils.build_query(params)
flash.now[:alert] = i18n_message(:invalid) if is_flashing_format?
self.response = recall_app(warden_options[:recall]).call(request.env).tap { |response|
status = response[0].in?(300..399) ? Devise.responder.redirect_status : Devise.responder.error_status
# Avoid warnings translating status to code using Rails if available (e.g. `unprocessable_entity` => `unprocessable_content`)
response[0] = ActionDispatch::Response.try(:rack_status_code, status) || Rack::Utils.status_code(status)
}
end
# Stores requested uri to redirect the user after signing in. We cannot use
# scoped session provided by warden here, since the user is not authenticated
# yet, but we still need to store the uri based on scope, so different scopes
# would never use the same uri to redirect.
def store_location!(scope)
session[:"#{scope}.return_to"] = request.request_uri if request && request.get?
def redirect
store_location!
if is_flashing_format?
if flash[:timedout] && flash[:alert]
flash.keep(:timedout)
flash.keep(:alert)
else
flash[:alert] = i18n_message
end
end
redirect_to redirect_url
end
protected
def i18n_options(options)
options
end
def i18n_message(default = nil)
message = warden_message || default || :unauthenticated
if message.is_a?(Symbol)
options = {}
options[:resource_name] = scope
options[:scope] = "devise.failure"
options[:default] = [message]
auth_keys = scope_class.authentication_keys
human_keys = (auth_keys.respond_to?(:keys) ? auth_keys.keys : auth_keys).map { |key|
scope_class.human_attribute_name(key).downcase
}
options[:authentication_keys] = human_keys.join(I18n.t(:"support.array.words_connector"))
options = i18n_options(options)
I18n.t(:"#{scope}.#{message}", **options).then { |msg|
# Ensure that auth keys at the start of the translated string are properly cased.
msg.start_with?(human_keys.first) ? msg.upcase_first : msg
}
else
message.to_s
end
end
def i18n_locale
warden_options[:locale]
end
def redirect_url
if warden_message == :timeout
flash[:timedout] = true if is_flashing_format?
path = if request.get?
attempted_path
else
request.referrer
end
path || scope_url
else
scope_url
end
end
def route(scope)
:"new_#{scope}_session_url"
end
def scope_url
opts = {}
# Initialize script_name with nil to prevent infinite loops in
# authenticated mounted engines
opts[:script_name] = nil
route = route(scope)
opts[:format] = request_format unless skip_format?
router_name = Devise.mappings[scope].router_name || Devise.available_router_name
context = send(router_name)
if relative_url_root?
opts[:script_name] = relative_url_root
end
if context.respond_to?(route)
context.send(route, opts)
elsif respond_to?(:root_url)
root_url(opts)
else
"/"
end
end
def skip_format?
%w(html */* turbo_stream).include? request_format.to_s
end
# Choose whether we should respond in an HTTP authentication fashion,
# including 401 and optional headers.
#
# This method allows the user to explicitly disable HTTP authentication
# on AJAX requests in case they want to redirect on failures instead of
# handling the errors on their own. This is useful in case your AJAX API
# is the same as your public API and uses a format like JSON (so you
# cannot mark JSON as a navigational format).
def http_auth?
if request.xhr?
Devise.http_authenticatable_on_xhr
else
!(request_format && is_navigational_format?)
end
end
# It doesn't make sense to send authenticate headers in AJAX requests
# or if the user disabled them.
def http_auth_header?
scope_class.http_authenticatable && !request.xhr?
end
def http_auth_body
return i18n_message unless request_format
method = "to_#{request_format}"
if method == "to_xml"
{ error: i18n_message }.to_xml(root: "errors")
elsif {}.respond_to?(method)
{ error: i18n_message }.send(method)
else
i18n_message
end
end
def recall_app(app)
controller, action = app.split("#")
controller_name = ActiveSupport::Inflector.camelize(controller)
controller_klass = ActiveSupport::Inflector.constantize("#{controller_name}Controller")
controller_klass.action(action)
end
def warden
request.respond_to?(:get_header) ? request.get_header("warden") : request.env["warden"]
end
def warden_options
request.respond_to?(:get_header) ? request.get_header("warden.options") : request.env["warden.options"]
end
def warden_message
@message ||= warden.message || warden_options[:message]
end
def scope
@scope ||= warden_options[:scope] || Devise.default_scope
end
def scope_class
@scope_class ||= Devise.mappings[scope].to
end
def attempted_path
warden_options[:attempted_path]
end
# Stores requested URI to redirect the user after signing in. We can't use
# the scoped session provided by warden here, since the user is not
# authenticated yet, but we still need to store the URI based on scope, so
# different scopes would never use the same URI to redirect.
def store_location!
store_location_for(scope, attempted_path) if request.get? && !http_auth?
end
def is_navigational_format?
Devise.navigational_formats.include?(request_format)
end
# Check if flash messages should be emitted. Default is to do it on
# navigational formats
def is_flashing_format?
request.respond_to?(:flash) && is_navigational_format?
end
def request_format
@request_format ||= request.format.try(:ref)
end
def relative_url_root
@relative_url_root ||= begin
config = Rails.application.config
config.try(:relative_url_root) || config.action_controller.try(:relative_url_root)
end
end
def relative_url_root?
relative_url_root.present?
end
ActiveSupport.run_load_hooks(:devise_failure_app, self)
end
end

View File

@@ -1,15 +1,12 @@
# Deny user access whenever his account is not active yet.
# frozen_string_literal: true
# Deny user access whenever their account is not active yet.
# We need this as hook to validate the user activity on each request
# and in case the user is using other strategies beside Devise ones.
Warden::Manager.after_set_user do |record, warden, options|
if record && record.respond_to?(:active?) && !record.active?
if record && record.respond_to?(:active_for_authentication?) && !record.active_for_authentication?
scope = options[:scope]
warden.logout(scope)
# If winning strategy was set, this is being called after authenticate and
# there is no need to force a redirect.
if warden.winning_strategy
warden.winning_strategy.fail!(record.inactive_message)
else
throw :warden, :scope => scope, :message => record.inactive_message
end
throw :warden, scope: scope, message: record.inactive_message, locale: options.fetch(:locale, I18n.locale)
end
end

View File

@@ -0,0 +1,14 @@
# frozen_string_literal: true
Warden::Manager.after_authentication do |record, warden, options|
clean_up_for_winning_strategy = !warden.winning_strategy.respond_to?(:clean_up_csrf?) ||
warden.winning_strategy.clean_up_csrf?
if Devise.clean_up_csrf_token_on_authentication && clean_up_for_winning_strategy
if warden.request.respond_to?(:reset_csrf_token)
# Rails 7.1+
warden.request.reset_csrf_token
else
warden.request.session.try(:delete, :_csrf_token)
end
end
end

View File

@@ -0,0 +1,11 @@
# frozen_string_literal: true
# Before logout hook to forget the user in the given scope, if it responds
# to forget_me! Also clear remember token to ensure the user won't be
# remembered again. Notice that we forget the user unless the record is not persisted.
# This avoids forgetting deleted users.
Warden::Manager.before_logout do |record, warden, options|
if record.respond_to?(:forget_me!)
Devise::Hooks::Proxy.new(warden).forget_me(record)
end
end

Some files were not shown because too many files have changed in this diff Show More