rodauth-rails 1.5.2 → 1.5.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d36f5274c33c95aab970521c38b77e9ac47242cc248e181f122b8ef518e5017
4
- data.tar.gz: d52e7ec12ebde869a023d6123b5550b061bb4210bc44bd4f4fa8200e592cf94d
3
+ metadata.gz: c63496f359a15bb061b6b419a609cbe63c24991e156731721d9f077ecf9deac4
4
+ data.tar.gz: 68212d9c722391c8c79f8bf8c48f8a05a39410ea0d97396876a6c2f5e92f103a
5
5
  SHA512:
6
- metadata.gz: f8162dd61a98976e3b06d6cee8575197f284e3415c8edcfa30ceed005fbedfe18f3d1c739253ce967434c35dc1ce01b246bd535069daaec92d71c807f2c91ac5
7
- data.tar.gz: cb6fe07c7cdb2a7d310ec1dcd60f35170fc478230b33d8cb193797b4db824c519ac4f2de588ff2f176ca96b7746ea7573a116e4497436eccaa640f073c8927ac
6
+ metadata.gz: 3632843dbd0214b73fa23134a0f2b42ec3b8f1c33430af1c776c685956ccf50e475840993299bff9863491456a369ad42b7e688e3ed03b783e51f4585d6be621
7
+ data.tar.gz: 6c123e024a51d3c2ba6b224b64c1f21d3b46363523d5b498e93fbe659052489660a61a3dd83da5080a07067d9052a82450da17a7bf156e9c905b2aa81ca861f6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ ## 1.5.4 (2022-07-21)
2
+
3
+ * Generate account fixtures in `spec/fixtures` directory when using RSpec (@benkoshy)
4
+
5
+ * Generate account fixtures in `test/fixtures` directory instead of `app/test/fixtures` (@benkoshy)
6
+
7
+ * Use string status column values in generated accounts fixture (@janko)
8
+
9
+ * Create integer status column in generated Sequel migration (@janko)
10
+
11
+ * Store password hash in accounts table in generated Sequel migration (@janko)
12
+
13
+ ## 1.5.3 (2022-07-21)
14
+
15
+ *Yanked*
16
+
1
17
  ## 1.5.2 (2022-07-03)
2
18
 
3
19
  * Bump Rodauth dependency version to 2.25+ (@janko)
data/README.md CHANGED
@@ -14,6 +14,7 @@ Provides Rails integration for the [Rodauth] authentication framework.
14
14
  🎥 Screencasts:
15
15
 
16
16
  * [Rails Authentication with Rodauth](https://www.youtube.com/watch?v=2hDpNikacf0)
17
+ * [Multifactor Authentication via TOTP with Rodauth](https://www.youtube.com/watch?v=9ON-kgXpz2A)
17
18
 
18
19
  📚 Articles:
19
20
 
@@ -66,7 +67,7 @@ Next, run the install generator:
66
67
  $ rails generate rodauth:install
67
68
  ```
68
69
 
69
- Or if you want Rodauth endpoints to be exposed via JSON API:
70
+ Or if you want Rodauth endpoints to be exposed via [JSON API]:
70
71
 
71
72
  ```sh
72
73
  $ rails generate rodauth:install --json # regular authentication using the Rails session
@@ -1215,3 +1216,4 @@ conduct](https://github.com/janko/rodauth-rails/blob/master/CODE_OF_CONDUCT.md).
1215
1216
  [custom mailer worker]: https://github.com/janko/rodauth-rails/wiki/Custom-Mailer-Worker
1216
1217
  [Turbo]: https://turbo.hotwired.dev/
1217
1218
  [rodauth-model]: https://github.com/janko/rodauth-model
1219
+ [JSON API]: https://github.com/janko/rodauth-rails/wiki/JSON-API
@@ -73,7 +73,11 @@ module Rodauth
73
73
  def create_fixtures
74
74
  test_unit_options = ::Rails.application.config.generators.options[:test_unit]
75
75
  if test_unit_options[:fixture] && test_unit_options[:fixture_replacement].nil?
76
- template "app/test/fixtures/accounts.yml"
76
+ if ::Rails.application.config.generators.options[:rails][:test_framework] == :rspec
77
+ template "test/fixtures/accounts.yml", "spec/fixtures/accounts.yml"
78
+ else
79
+ template "test/fixtures/accounts.yml", "test/fixtures/accounts.yml"
80
+ end
77
81
  end
78
82
  end
79
83
 
@@ -13,16 +13,11 @@ create_table :accounts do
13
13
  <% else -%>
14
14
  String :email, null: false
15
15
  <% end -%>
16
- String :status, null: false, default: "unverified"
16
+ Integer :status, null: false, default: 1
17
17
  <% if db.supports_partial_indexes? -%>
18
- index :email, unique: true, where: { status: ["unverified", "verified"] }
18
+ index :email, unique: true, where: { status: [1, 2] }
19
19
  <% else -%>
20
20
  index :email, unique: true
21
21
  <% end -%>
22
- end
23
-
24
- # Used if storing password hashes in a separate table (default)
25
- create_table :account_password_hashes do
26
- foreign_key :id, :accounts, primary_key: true, type: :Bignum
27
- String :password_hash, null: false
22
+ String :password_hash
28
23
  end
@@ -2,9 +2,9 @@
2
2
  one:
3
3
  email: freddie@queen.com
4
4
  password_hash: <%%= BCrypt::Password.create("password", cost: BCrypt::Engine::MIN_COST) %>
5
- status: 2
5
+ status: verified
6
6
 
7
7
  two:
8
8
  email: brian@queen.com
9
9
  password_hash: <%%= BCrypt::Password.create("password", cost: BCrypt::Engine::MIN_COST) %>
10
- status: 2
10
+ status: verified
@@ -1,5 +1,5 @@
1
1
  module Rodauth
2
2
  module Rails
3
- VERSION = "1.5.2"
3
+ VERSION = "1.5.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rodauth-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.2
4
+ version: 1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janko Marohnić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-02 00:00:00.000000000 Z
11
+ date: 2022-07-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -224,7 +224,6 @@ files:
224
224
  - lib/generators/rodauth/templates/app/misc/rodauth_app.rb
225
225
  - lib/generators/rodauth/templates/app/misc/rodauth_main.rb
226
226
  - lib/generators/rodauth/templates/app/models/account.rb
227
- - lib/generators/rodauth/templates/app/test/fixtures/accounts.yml
228
227
  - lib/generators/rodauth/templates/app/views/rodauth/_email_auth_request_form.html.erb
229
228
  - lib/generators/rodauth/templates/app/views/rodauth/_login_form.html.erb
230
229
  - lib/generators/rodauth/templates/app/views/rodauth/_login_form_footer.html.erb
@@ -272,6 +271,7 @@ files:
272
271
  - lib/generators/rodauth/templates/config/initializers/rodauth.rb
273
272
  - lib/generators/rodauth/templates/config/initializers/sequel.rb
274
273
  - lib/generators/rodauth/templates/db/migrate/create_rodauth.rb
274
+ - lib/generators/rodauth/templates/test/fixtures/accounts.yml
275
275
  - lib/generators/rodauth/views_generator.rb
276
276
  - lib/rodauth-rails.rb
277
277
  - lib/rodauth/rails.rb