mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
User email confirmation is now optional
This commit is contained in:
@@ -4,3 +4,5 @@ POSTGRES_USER=yourusernamehere
|
|||||||
POSTGRES_PASSWORD=yourpasswordhere
|
POSTGRES_PASSWORD=yourpasswordhere
|
||||||
|
|
||||||
APP_NAME="You App Name Here"
|
APP_NAME="You App Name Here"
|
||||||
|
|
||||||
|
EMAIL_CONFIRMATION=0
|
||||||
@@ -1,7 +1,8 @@
|
|||||||
class User < ApplicationRecord
|
class User < ApplicationRecord
|
||||||
devise :database_authenticatable, :registerable,
|
devise :database_authenticatable, :registerable,
|
||||||
:recoverable, :rememberable, :validatable,
|
:recoverable, :rememberable, :validatable
|
||||||
:confirmable
|
|
||||||
|
self.send(:devise, :confirmable) if Rails.application.email_confirmation?
|
||||||
|
|
||||||
has_many :comments
|
has_many :comments
|
||||||
|
|
||||||
|
|||||||
@@ -19,5 +19,9 @@ module App
|
|||||||
def name
|
def name
|
||||||
ENV["APP_NAME"]
|
ENV["APP_NAME"]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def email_confirmation?
|
||||||
|
ENV["EMAIL_CONFIRMATION"] == "1"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user