Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/api/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ gem 'dimapa'
# Network Kanji Filter, for Kanji conversions (former kconv)
gem 'nkf'

# Authentication
gem 'devise', '~> 4.2'

# For Hotwire javascript libraries
gem 'importmap-rails'
gem 'turbo-rails'
Expand Down
10 changes: 10 additions & 0 deletions src/api/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ GEM
delayed_job_active_record (4.1.11)
activerecord (>= 3.0, < 9.0)
delayed_job (>= 3.0, < 5)
devise (4.9.4)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
diff-lcs (1.6.2)
dimapa (0.1.0)
docile (1.4.1)
Expand Down Expand Up @@ -327,6 +333,7 @@ GEM
octokit (10.0.0)
faraday (>= 1, < 3)
sawyer (~> 0.9)
orm_adapter (0.5.0)
ostruct (0.6.3)
paper_trail (16.0.0)
activerecord (>= 6.1)
Expand Down Expand Up @@ -568,6 +575,8 @@ GEM
method_source (~> 1.0)
voight_kampff (2.0.0)
rack (>= 1.4)
warden (1.2.9)
rack (>= 2.0.9)
webmock (3.25.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
Expand Down Expand Up @@ -621,6 +630,7 @@ DEPENDENCIES
database_consistency
deep_cloneable
delayed_job_active_record
devise (~> 4.2)
dimapa
down
factory_bot_rails
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/unregistered_user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def self.register(opts)
# last_logged_in_at :datetime
# login :text(65535) uniquely indexed
# login_failure_count :integer default(0), not null
# password_digest :string(255)
# old_password_digest :string(255)
# realname :string(200) default(""), not null
# rss_secret :string(200) uniquely indexed
# state :string default("unconfirmed"), indexed
Expand Down
3 changes: 2 additions & 1 deletion src/api/app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ class User < ApplicationRecord
too_long: 'must have less than 100 characters',
too_short: 'must have more than two characters' }

validates :old_password_digest, length: { maximum: 255 }
validates :state, inclusion: { in: STATES }

validate :validate_state
Expand Down Expand Up @@ -880,7 +881,7 @@ def lookup_strategy
# last_logged_in_at :datetime
# login :text(65535) uniquely indexed
# login_failure_count :integer default(0), not null
# password_digest :string(255)
# old_password_digest :string(255)
# realname :string(200) default(""), not null
# rss_secret :string(200) uniquely indexed
# state :string default("unconfirmed"), indexed
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RenamePasswordDigestToOldPasswordDigestInUsers < ActiveRecord::Migration[7.2]
def change
safety_assured { rename_column :users, :password_digest, :old_password_digest }
end
end
4 changes: 2 additions & 2 deletions src/api/db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema[7.2].define(version: 2025_09_15_120837) do
ActiveRecord::Schema[7.2].define(version: 2025_09_25_123600) do
create_table "active_storage_attachments", id: :integer, charset: "utf8mb4", collation: "utf8mb4_unicode_ci", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
Expand Down Expand Up @@ -1196,7 +1196,7 @@
t.text "login", collation: "utf8mb4_bin"
t.string "email", limit: 200, default: "", null: false
t.string "realname", limit: 200, default: "", null: false
t.string "password_digest", collation: "utf8mb4_bin"
t.string "old_password_digest", collation: "utf8mb4_bin"
t.string "deprecated_password", collation: "utf8mb4_bin"
t.string "deprecated_password_hash_type", collation: "utf8mb4_bin"
t.string "deprecated_password_salt", collation: "utf8mb4_bin"
Expand Down
Binary file added src/api/vendor/cache/devise-4.9.4.gem
Binary file not shown.
Binary file added src/api/vendor/cache/orm_adapter-0.5.0.gem
Binary file not shown.
Binary file added src/api/vendor/cache/responders-3.1.1.gem
Binary file not shown.
Binary file added src/api/vendor/cache/warden-1.2.9.gem
Binary file not shown.