Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP DO NOT MERGE - First draft at adding email confirmation #909

Closed
wants to merge 4 commits into from
Closed
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public/javascripts/*
public/stylesheets/*
public/system/*
public/videos/*
public/tinymce/skins/*

# Ignore PO/POT backups
*.po.bak
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class User < ApplicationRecord
# :token_authenticatable, :confirmable,
# :lockable, :timeoutable and :omniauthable
devise :invitable, :database_authenticatable, :registerable, :recoverable,
:rememberable, :trackable, :validatable, :omniauthable,
:rememberable, :trackable, :validatable, :omniauthable, :confirmable,
omniauth_providers: %i[shibboleth orcid openid_connect]

##
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/devise.rb
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
# initial account confirmation) to be applied. Requires additional unconfirmed_email
# db field (see migrations). Until confirmed new email is stored in
# unconfirmed email column, and copied to email column on successful confirmation.
config.reconfirmable = false
config.reconfirmable = true

# Defines which key will be used when confirming an account
# config.confirmation_keys = [ :email ]
Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20240919191444_add_unconfirmed_email_to_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddUnconfirmedEmailToUsers < ActiveRecord::Migration[6.1]
def change
add_column :users, :unconfirmed_email, :string
end
end
3 changes: 2 additions & 1 deletion 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.define(version: 2024_08_20_190548) do
ActiveRecord::Schema.define(version: 2024_09_19_191444) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -824,6 +824,7 @@
t.boolean "active", default: true
t.integer "department_id"
t.datetime "last_api_access"
t.string "unconfirmed_email"
t.index ["department_id"], name: "fk_rails_f29bf9cdf2"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["language_id"], name: "fk_rails_45f4f12508"
Expand Down
Loading