veri 2.0.1 → 2.0.2

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: 1d4ce50f8dee062c8b115095760ba5c2ef1e4f6a75db253a12fbb872583b5491
4
- data.tar.gz: 20948f1a5cfbfb8054b2fb66491d9babae554197487b1369f99f7b5e5d8a213c
3
+ metadata.gz: c9b0db1fbb87c0a3b25d47f2142cab1b9143a0ba7751a05c1676ca6e3b4b6ee3
4
+ data.tar.gz: 600d600760a3c0af2fddfece43322193be1ae4255eae0dd1c22d4099a083cb7b
5
5
  SHA512:
6
- metadata.gz: f49a78fc5ccba47ece10a67a2b651173ea28000a9aa43b886c514d74334c1273e59b77d07893590014b639b42f324636c025288f5e4a6657c932f222140fb258
7
- data.tar.gz: 8a3ab38f067b650708e4c0a13af58dbac9ac60fcca30b038c4fbd8a12c6851d55502a5f9033d886d9a345cbe7f06e34bced6160f4d812b8b9bef7792de707e75
6
+ metadata.gz: aaf5ec5aced9ddec1c42367df39be9e4322d3b1b3946bb473bfaee3f668d6fea55d78b48f3f1f0fa1acb8ee4588de8039d054730d3b913ab8036def74054d858
7
+ data.tar.gz: b188516f09afc341584f4460d5caa0e552c94e54dfe3a4bc3fe7a4cddb592acbb8c4957092e4763e88bd1be34ebc122934b40876bd2fc23e87d3b207b5fb2479
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v2.0.2
2
+
3
+ ### Misc
4
+
5
+ - Clarified error message for non-existent user model
6
+
1
7
  ## v2.0.1
2
8
 
3
9
  ### Misc
data/README.md CHANGED
@@ -70,10 +70,14 @@ Configure Veri in an initializer if customization is needed:
70
70
  ```rb
71
71
  # These are the default values; you can change them as needed
72
72
  Veri.configure do |config|
73
- config.hashing_algorithm = :argon2 # Password hashing algorithm (:argon2, :bcrypt, :pbkdf2, or :scrypt)
74
- config.inactive_session_lifetime = nil # Session inactivity timeout (nil means sessions never expire due to inactivity)
75
- config.total_session_lifetime = 14.days # Maximum session duration regardless of activity
76
- config.user_model_name = "User" # Your user model name
73
+ # Password hashing algorithm (:argon2, :bcrypt, :pbkdf2, or :scrypt)
74
+ config.hashing_algorithm = :argon2
75
+ # Session inactivity timeout (nil means sessions never expire due to inactivity)
76
+ config.inactive_session_lifetime = nil
77
+ # Maximum session duration regardless of activity
78
+ config.total_session_lifetime = 14.days
79
+ # Your user model name
80
+ config.user_model_name = "User"
77
81
  end
78
82
  ```
79
83
 
@@ -88,6 +92,12 @@ user.update_password("password")
88
92
  # Verify a password
89
93
  user.verify_password("password")
90
94
  ```
95
+ Changing a password does not automatically terminate existing sessions. If you want to invalidate the user's sessions after a password change, do so explicitly:
96
+
97
+ ```rb
98
+ user.update_password(new_password)
99
+ user.sessions.terminate_all
100
+ ```
91
101
 
92
102
  ## Controller Integration
93
103
 
@@ -99,11 +109,13 @@ Include the authentication module in your controllers and configure protection:
99
109
  class ApplicationController < ActionController::Base
100
110
  include Veri::Authentication
101
111
 
102
- with_authentication # Require authentication by default
112
+ # Require authentication by default
113
+ with_authentication
103
114
  end
104
115
 
105
116
  class PicturesController < ApplicationController
106
- skip_authentication only: [:index, :show] # Allow public access to index and show actions
117
+ # Allow public access to index and show actions
118
+ skip_authentication only: [:index, :show]
107
119
  end
108
120
  ```
109
121
 
@@ -161,7 +173,7 @@ current_user
161
173
  # Returns true if user is authenticated
162
174
  logged_in?
163
175
 
164
- # Authenticates user and creates session, returns true on success or false if account is locked
176
+ # Authenticates user, returns true on success or false if account is locked
165
177
  log_in(user)
166
178
 
167
179
  # Terminates current session
@@ -408,6 +420,12 @@ To clean up orphaned sessions, use:
408
420
  Veri::Session.prune
409
421
  ```
410
422
 
423
+ Or, for a specific user:
424
+
425
+ ```rb
426
+ user.sessions.prune
427
+ ```
428
+
411
429
  ### Tenant Migrations
412
430
 
413
431
  When you rename or remove models used as tenants, you need to update Veri's stored data accordingly. Use these irreversible data migrations:
@@ -484,7 +502,7 @@ end
484
502
  ## Getting Help and Contributing
485
503
 
486
504
  ### Getting Help
487
- Have a question or need assistance? Open a discussion in our [discussions section](https://github.com/enjaku4/veri/discussions) for:
505
+ Have a question or need assistance? Open a discussion in the [discussions section](https://github.com/enjaku4/veri/discussions) for:
488
506
  - Usage questions
489
507
  - Implementation guidance
490
508
  - Feature suggestions
@@ -499,7 +517,7 @@ Found a bug? Please [create an issue](https://github.com/enjaku4/veri/issues) wi
499
517
  Ready to contribute? You can:
500
518
  - Fix bugs by submitting pull requests
501
519
  - Improve documentation
502
- - Add new features (please discuss first in our [discussions section](https://github.com/enjaku4/veri/discussions))
520
+ - Add new features (please discuss first in the [discussions section](https://github.com/enjaku4/veri/discussions))
503
521
 
504
522
  Before contributing, please read the [contributing guidelines](https://github.com/enjaku4/veri/blob/main/CONTRIBUTING.md)
505
523
 
@@ -66,7 +66,7 @@ module Veri
66
66
  Veri::Inputs::Model.new(
67
67
  user_model_name,
68
68
  error: Veri::ConfigurationError,
69
- message: "Invalid user model name `#{user_model_name}`, expected an ActiveRecord model name as a string"
69
+ message: "Invalid user model name `#{user_model_name}`, model does not exist"
70
70
  ).process
71
71
  end
72
72
 
data/lib/veri/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Veri
2
- VERSION = "2.0.1".freeze
2
+ VERSION = "2.0.2".freeze
3
3
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: veri
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - enjaku4
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-02-04 00:00:00.000000000 Z
10
+ date: 2026-03-28 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: argon2
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
147
147
  - !ruby/object:Gem::Version
148
148
  version: '0'
149
149
  requirements: []
150
- rubygems_version: 3.6.9
150
+ rubygems_version: 4.0.3
151
151
  specification_version: 4
152
152
  summary: Minimal cookie-based authentication library for Ruby on Rails
153
153
  test_files: []