phcdevworks_accounts 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +6 -0
  4. data/Rakefile +32 -0
  5. data/app/assets/config/phcdevworks_accounts_manifest.js +2 -0
  6. data/app/assets/javascripts/phcdevworks_accounts/application.js +2 -0
  7. data/app/assets/stylesheets/phcdevworks_accounts/application.scss +2 -0
  8. data/app/controllers/phcdevworks_accounts/account/dashboard_controller.rb +11 -0
  9. data/app/controllers/phcdevworks_accounts/admin/accounts_controller.rb +14 -0
  10. data/app/controllers/phcdevworks_accounts/application_controller.rb +30 -0
  11. data/app/helpers/phcdevworks_accounts/application_helper.rb +4 -0
  12. data/app/jobs/phcdevworks_accounts/application_job.rb +4 -0
  13. data/app/mailers/phcdevworks_accounts/application_mailer.rb +6 -0
  14. data/app/models/phcdevworks_accounts/application_record.rb +5 -0
  15. data/app/models/phcdevworks_accounts/user.rb +36 -0
  16. data/app/views/layouts/phcdevworks_accounts/application.html.erb +79 -0
  17. data/app/views/layouts/phcdevworks_accounts/application_full_width.html.erb +75 -0
  18. data/app/views/layouts/phcdevworks_accounts/application_no_sidebar.html.erb +68 -0
  19. data/app/views/layouts/phcdevworks_accounts/components/backend/footer/_footer.html.erb +16 -0
  20. data/app/views/layouts/phcdevworks_accounts/components/backend/navigation/_top_menu.html.erb +37 -0
  21. data/app/views/layouts/phcdevworks_accounts/components/backend/sidebars/_side_menu.html.erb +86 -0
  22. data/app/views/layouts/phcdevworks_accounts/devise.html.erb +48 -0
  23. data/app/views/phcdevworks_accounts/account/dashboard/index.html.erb +0 -0
  24. data/app/views/phcdevworks_accounts/admin/accounts/index.html.erb +0 -0
  25. data/app/views/phcdevworks_accounts/admin/accounts/users_index.html.erb +0 -0
  26. data/app/views/users/confirmations/new.html.erb +62 -0
  27. data/app/views/users/mailer/confirmation_instructions.html.erb +5 -0
  28. data/app/views/users/mailer/email_changed.html.erb +7 -0
  29. data/app/views/users/mailer/password_change.html.erb +3 -0
  30. data/app/views/users/mailer/reset_password_instructions.html.erb +8 -0
  31. data/app/views/users/mailer/unlock_instructions.html.erb +7 -0
  32. data/app/views/users/passwords/edit.html.erb +73 -0
  33. data/app/views/users/passwords/new.html.erb +65 -0
  34. data/app/views/users/registrations/edit.html.erb +101 -0
  35. data/app/views/users/registrations/new.html.erb +107 -0
  36. data/app/views/users/sessions/new.html.erb +81 -0
  37. data/app/views/users/shared/_links.html.erb +25 -0
  38. data/app/views/users/unlocks/new.html.erb +62 -0
  39. data/config/initializers/devise.rb +311 -0
  40. data/config/locales/devise.en.yml +65 -0
  41. data/config/routes.rb +13 -0
  42. data/db/migrate/20190701112047_devise_create_phcdevworks_accounts_users.rb +44 -0
  43. data/db/migrate/20190701120003_add_userinfo_to_users.rb +15 -0
  44. data/db/migrate/20190701120028_add_role_to_users.rb +7 -0
  45. data/db/migrate/20190701120045_add_terms_to_users.rb +7 -0
  46. data/lib/phcdevworks_accounts/engine.rb +35 -0
  47. data/lib/phcdevworks_accounts/version.rb +3 -0
  48. data/lib/phcdevworks_accounts.rb +5 -0
  49. data/lib/tasks/phcdevworks_accounts_tasks.rake +4 -0
  50. metadata +265 -0
@@ -0,0 +1,311 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Use this hook to configure devise mailer, warden hooks and so forth.
4
+ # Many of these configuration options can be set straight in your model.
5
+ Devise.setup do |config|
6
+
7
+ # The secret key used by Devise. Devise uses this key to generate
8
+ # random tokens. Changing this key will render invalid all existing
9
+ # confirmation, reset password and unlock tokens in the database.
10
+ # Devise will use the `secret_key_base` as its `secret_key`
11
+ # by default. You can change it below and use your own secret key.
12
+ config.secret_key = ENV['SECRET_KEY_BASE'] if Rails.env.production?
13
+ config.secret_key = 'fc3c064ce2237384104a538c191a374e75e7b9f3a7e1e531e0e07a43a6e3693ea4834a40b9618e707c6981588c79fc69b42dc2c4b8b835c23a1564d0e1fa7410' if Rails.env.development?
14
+
15
+ # ==> Controller configuration
16
+ # Configure the parent class to the devise controllers.
17
+ config.parent_controller = 'PhcdevworksAccounts::ApplicationController'
18
+
19
+ # ==> Mailer Configuration
20
+ # Configure the e-mail address which will be shown in Devise::Mailer,
21
+ # note that it will be overwritten if you use your own mailer class
22
+ # with default "from" parameter.
23
+ config.mailer_sender = ENV['PHCDEV_EMAIL_SENDER']
24
+
25
+ # Configure the class responsible to send e-mails.
26
+ # config.mailer = 'Devise::Mailer'
27
+
28
+ # Configure the parent class responsible to send e-mails.
29
+ # config.parent_mailer = 'ActionMailer::Base'
30
+
31
+ # ==> ORM configuration
32
+ # Load and configure the ORM. Supports :active_record (default) and
33
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
34
+ # available as additional gems.
35
+ require 'devise/orm/active_record'
36
+
37
+ # ==> Configuration for any authentication mechanism
38
+ # Configure which keys are used when authenticating a user. The default is
39
+ # just :email. You can configure it to use [:username, :subdomain], so for
40
+ # authenticating a user, both parameters are required. Remember that those
41
+ # parameters are used only when authenticating and not when retrieving from
42
+ # session. If you need permissions, you should implement that in a before filter.
43
+ # You can also supply a hash where the value is a boolean determining whether
44
+ # or not authentication should be aborted when the value is not present.
45
+ # config.authentication_keys = [:email]
46
+
47
+ # Configure parameters from the request object used for authentication. Each entry
48
+ # given should be a request method and it will automatically be passed to the
49
+ # find_for_authentication method and considered in your model lookup. For instance,
50
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
51
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
52
+ # config.request_keys = []
53
+
54
+ # Configure which authentication keys should be case-insensitive.
55
+ # These keys will be downcased upon creating or modifying a user and when used
56
+ # to authenticate or find a user. Default is :email.
57
+ config.case_insensitive_keys = [:email]
58
+
59
+ # Configure which authentication keys should have whitespace stripped.
60
+ # These keys will have whitespace before and after removed upon creating or
61
+ # modifying a user and when used to authenticate or find a user. Default is :email.
62
+ config.strip_whitespace_keys = [:email]
63
+
64
+ # Tell if authentication through request.params is enabled. True by default.
65
+ # It can be set to an array that will enable params authentication only for the
66
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
67
+ # enable it only for database (email + password) authentication.
68
+ # config.params_authenticatable = true
69
+
70
+ # Tell if authentication through HTTP Auth is enabled. False by default.
71
+ # It can be set to an array that will enable http authentication only for the
72
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
73
+ # enable it only for database authentication. The supported strategies are:
74
+ # :database = Support basic authentication with authentication key + password
75
+ # config.http_authenticatable = false
76
+
77
+ # If 401 status code should be returned for AJAX requests. True by default.
78
+ # config.http_authenticatable_on_xhr = true
79
+
80
+ # The realm used in Http Basic Authentication. 'Application' by default.
81
+ # config.http_authentication_realm = 'Application'
82
+
83
+ # It will change confirmation, password recovery and other workflows
84
+ # to behave the same regardless if the e-mail provided was right or wrong.
85
+ # Does not affect registerable.
86
+ # config.paranoid = true
87
+
88
+ # By default Devise will store the user in session. You can skip storage for
89
+ # particular strategies by setting this option.
90
+ # Notice that if you are skipping storage for all authentication paths, you
91
+ # may want to disable generating routes to Devise's sessions controller by
92
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
93
+ config.skip_session_storage = [:http_auth]
94
+
95
+ # By default, Devise cleans up the CSRF token on authentication to
96
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
97
+ # requests for sign in and sign up, you need to get a new CSRF token
98
+ # from the server. You can disable this option at your own risk.
99
+ # config.clean_up_csrf_token_on_authentication = true
100
+
101
+ # When false, Devise will not attempt to reload routes on eager load.
102
+ # This can reduce the time taken to boot the app but if your application
103
+ # requires the Devise mappings to be loaded during boot time the application
104
+ # won't boot properly.
105
+ # config.reload_routes = true
106
+
107
+ # ==> Configuration for :database_authenticatable
108
+ # For bcrypt, this is the cost for hashing the password and defaults to 11. If
109
+ # using other algorithms, it sets how many times you want the password to be hashed.
110
+ #
111
+ # Limiting the stretches to just one in testing will increase the performance of
112
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
113
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
114
+ # algorithm), the cost increases exponentially with the number of stretches (e.g.
115
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
116
+ config.stretches = Rails.env.test? ? 1 : 11
117
+
118
+ # Set up a pepper to generate the hashed password.
119
+ # config.pepper = '17a8fed3dc8f20a7128531632f608dba45e7b136429eba57e85a04576cd28382121417c42fc4c5fa31dc67513d410e0e83c749e474ab4fba46779b665fa0b1bb'
120
+
121
+ # Send a notification to the original email when the user's email is changed.
122
+ # config.send_email_changed_notification = false
123
+
124
+ # Send a notification email when the user's password is changed.
125
+ # config.send_password_change_notification = false
126
+
127
+ # ==> Configuration for :confirmable
128
+ # A period that the user is allowed to access the website even without
129
+ # confirming their account. For instance, if set to 2.days, the user will be
130
+ # able to access the website for two days without confirming their account,
131
+ # access will be blocked just in the third day.
132
+ # You can also set it to nil, which will allow the user to access the website
133
+ # without confirming their account.
134
+ # Default is 0.days, meaning the user cannot access the website without
135
+ # confirming their account.
136
+ # config.allow_unconfirmed_access_for = 2.days
137
+
138
+ # A period that the user is allowed to confirm their account before their
139
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
140
+ # their account within 3 days after the mail was sent, but on the fourth day
141
+ # their account can't be confirmed with the token any more.
142
+ # Default is nil, meaning there is no restriction on how long a user can take
143
+ # before confirming their account.
144
+ # config.confirm_within = 3.days
145
+
146
+ # If true, requires any email changes to be confirmed (exactly the same way as
147
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
148
+ # db field (see migrations). Until confirmed, new email is stored in
149
+ # unconfirmed_email column, and copied to email column on successful confirmation.
150
+ config.reconfirmable = true
151
+
152
+ # Defines which key will be used when confirming an account
153
+ # config.confirmation_keys = [:email]
154
+
155
+ # ==> Configuration for :rememberable
156
+ # The time the user will be remembered without asking for credentials again.
157
+ # config.remember_for = 2.weeks
158
+
159
+ # Invalidates all the remember me tokens when the user signs out.
160
+ config.expire_all_remember_me_on_sign_out = true
161
+
162
+ # If true, extends the user's remember period when remembered via cookie.
163
+ # config.extend_remember_period = false
164
+
165
+ # Options to be passed to the created cookie. For instance, you can set
166
+ # secure: true in order to force SSL only cookies.
167
+ # config.rememberable_options = {}
168
+
169
+ # ==> Configuration for :validatable
170
+ # Range for password length.
171
+ config.password_length = 6..32
172
+
173
+ # Email regex used to validate email formats. It simply asserts that
174
+ # one (and only one) @ exists in the given string. This is mainly
175
+ # to give user feedback and not to assert the e-mail validity.
176
+ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
177
+
178
+ # ==> Configuration for :timeoutable
179
+ # The time you want to timeout the user session without activity. After this
180
+ # time the user will be asked for credentials again. Default is 30 minutes.
181
+ # config.timeout_in = 30.minutes
182
+
183
+ # ==> Configuration for :lockable
184
+ # Defines which strategy will be used to lock an account.
185
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
186
+ # :none = No lock strategy. You should handle locking by yourself.
187
+ # config.lock_strategy = :failed_attempts
188
+
189
+ # Defines which key will be used when locking and unlocking an account
190
+ # config.unlock_keys = [:email]
191
+
192
+ # Defines which strategy will be used to unlock an account.
193
+ # :email = Sends an unlock link to the user email
194
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
195
+ # :both = Enables both strategies
196
+ # :none = No unlock strategy. You should handle unlocking by yourself.
197
+ # config.unlock_strategy = :both
198
+
199
+ # Number of authentication tries before locking an account if lock_strategy
200
+ # is failed attempts.
201
+ # config.maximum_attempts = 20
202
+
203
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
204
+ # config.unlock_in = 1.hour
205
+
206
+ # Warn on the last attempt before the account is locked.
207
+ # config.last_attempt_warning = true
208
+
209
+ # ==> Configuration for :recoverable
210
+ #
211
+ # Defines which key will be used when recovering the password for an account
212
+ # config.reset_password_keys = [:email]
213
+
214
+ # Time interval you can reset your password with a reset password key.
215
+ # Don't put a too small interval or your users won't have the time to
216
+ # change their passwords.
217
+ config.reset_password_within = 6.hours
218
+
219
+ # When set to false, does not sign a user in automatically after their password is
220
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
221
+ # config.sign_in_after_reset_password = true
222
+
223
+ # ==> Configuration for :encryptable
224
+ # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
225
+ # You can use :sha1, :sha512 or algorithms from others authentication tools as
226
+ # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
227
+ # for default behavior) and :restful_authentication_sha1 (then you should set
228
+ # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
229
+ #
230
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
231
+ # config.encryptor = :sha512
232
+
233
+ # ==> Scopes configuration
234
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
235
+ # "users/sessions/new". It's turned off by default because it's slower if you
236
+ # are using only default views.
237
+ config.scoped_views = true
238
+
239
+ # Configure the default scope given to Warden. By default it's the first
240
+ # devise role declared in your routes (usually :user).
241
+ config.default_scope = :user
242
+
243
+ # Set this configuration to false if you want /users/sign_out to sign out
244
+ # only the current scope. By default, Devise signs out all scopes.
245
+ config.sign_out_all_scopes = true
246
+
247
+ # ==> Navigation configuration
248
+ # Lists the formats that should be treated as navigational. Formats like
249
+ # :html, should redirect to the sign in page when the user does not have
250
+ # access, but formats like :xml or :json, should return 401.
251
+ #
252
+ # If you have any extra navigational formats, like :iphone or :mobile, you
253
+ # should add them to the navigational formats lists.
254
+ #
255
+ # The "*/*" below is required to match Internet Explorer requests.
256
+ # config.navigational_formats = ['*/*', :html]
257
+
258
+ # The default HTTP method used to sign out a resource. Default is :delete.
259
+ config.sign_out_via = :delete
260
+
261
+ # ==> OmniAuth
262
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
263
+ # up on your models and hooks.
264
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
265
+
266
+ # ==> Warden configuration
267
+ # If you want to use other strategies, that are not supported by Devise, or
268
+ # change the failure app, you can configure them inside the config.warden block.
269
+ #
270
+ # config.warden do |manager|
271
+ # manager.intercept_401 = false
272
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
273
+ # end
274
+
275
+ # ==> Mountable engine configurations
276
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
277
+ # is mountable, there are some extra configurations to be taken into account.
278
+ # The following options are available, assuming the engine is mounted as:
279
+ #
280
+ # mount MyEngine, at: '/my_engine'
281
+ #
282
+ # The router that invoked `devise_for`, in the example above, would be:
283
+ config.router_name = :phcdevworks_accounts
284
+ #
285
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
286
+ # so you need to do it manually. For the users scope, it would be:
287
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
288
+
289
+ # ==> Turbolinks configuration
290
+ # If your app is using Turbolinks, Turbolinks::Controller needs to be included to make redirection work correctly:
291
+ #
292
+ # ActiveSupport.on_load(:devise_failure_app) do
293
+ # include Turbolinks::Controller
294
+ # end
295
+
296
+ # ==> Configuration for :registerable
297
+
298
+ # When set to false, does not sign a user in automatically after their password is
299
+ # changed. Defaults to true, so a user is signed in automatically after changing a password.
300
+ # config.sign_in_after_change_password = true
301
+
302
+ # Change Layouts According to Controller
303
+ Rails.application.config.to_prepare do
304
+ Devise::SessionsController.layout "phcdevworks_accounts/devise"
305
+ Devise::RegistrationsController.layout proc{ |controller| user_signed_in? ? "phcdevworks_accounts/application" : "phcdevworks_accounts/devise" }
306
+ Devise::ConfirmationsController.layout "phcdevworks_accounts/application_no_sidebar"
307
+ Devise::UnlocksController.layout "phcdevworks_accounts/application_no_sidebar"
308
+ Devise::PasswordsController.layout "phcdevworks_accounts/application_no_sidebar"
309
+ end
310
+
311
+ end
@@ -0,0 +1,65 @@
1
+ # Additional translations at https://github.com/plataformatec/devise/wiki/I18n
2
+
3
+ en:
4
+ devise:
5
+ confirmations:
6
+ confirmed: "Your email address has been successfully confirmed."
7
+ send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
8
+ send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
9
+ failure:
10
+ already_authenticated: "You are already signed in."
11
+ inactive: "Your account is not activated yet."
12
+ invalid: "Invalid %{authentication_keys} or password."
13
+ locked: "Your account is locked."
14
+ last_attempt: "You have one more attempt before your account is locked."
15
+ not_found_in_database: "Invalid %{authentication_keys} or password."
16
+ timeout: "Your session expired. Please sign in again to continue."
17
+ unauthenticated: "You need to sign in or sign up before continuing."
18
+ unconfirmed: "You have to confirm your email address before continuing."
19
+ mailer:
20
+ confirmation_instructions:
21
+ subject: "Confirmation instructions"
22
+ reset_password_instructions:
23
+ subject: "Reset password instructions"
24
+ unlock_instructions:
25
+ subject: "Unlock instructions"
26
+ email_changed:
27
+ subject: "Email Changed"
28
+ password_change:
29
+ subject: "Password Changed"
30
+ omniauth_callbacks:
31
+ failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
32
+ success: "Successfully authenticated from %{kind} account."
33
+ passwords:
34
+ no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
35
+ send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
36
+ send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
37
+ updated: "Your password has been changed successfully. You are now signed in."
38
+ updated_not_active: "Your password has been changed successfully."
39
+ registrations:
40
+ destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
41
+ signed_up: "Welcome! You have signed up successfully."
42
+ signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
43
+ signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
44
+ signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
45
+ update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
46
+ updated: "Your account has been updated successfully."
47
+ updated_but_not_signed_in: "Your account has been updated successfully, but since your password was changed, you need to sign in again"
48
+ sessions:
49
+ signed_in: "Signed in successfully."
50
+ signed_out: "Signed out successfully."
51
+ already_signed_out: "Signed out successfully."
52
+ unlocks:
53
+ send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
54
+ send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
55
+ unlocked: "Your account has been unlocked successfully. Please sign in to continue."
56
+ errors:
57
+ messages:
58
+ already_confirmed: "was already confirmed, please try signing in"
59
+ confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
60
+ expired: "has expired, please request a new one"
61
+ not_found: "not found"
62
+ not_locked: "was not locked"
63
+ not_saved:
64
+ one: "1 error prohibited this %{resource} from being saved:"
65
+ other: "%{count} errors prohibited this %{resource} from being saved:"
data/config/routes.rb ADDED
@@ -0,0 +1,13 @@
1
+ PhcdevworksAccounts::Engine.routes.draw do
2
+
3
+ # User Routes
4
+ devise_for :users, class_name: "PhcdevworksAccounts::User", module: :devise
5
+
6
+ # User Dashboard
7
+ get 'dashboard', to: 'accounts/dashboard#index'
8
+
9
+ # Admin Routes
10
+ get "admin_dashboard", to: "admin/accounts#index"
11
+ get "admin_users_index", to: "admin/accounts#users_index"
12
+
13
+ end
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ class DeviseCreatePhcdevworksAccountsUsers < ActiveRecord::Migration[6.0]
4
+ def change
5
+ create_table :phcdevworks_accounts_users do |t|
6
+ ## Database authenticatable
7
+ t.string :email, null: false, default: ""
8
+ t.string :encrypted_password, null: false, default: ""
9
+
10
+ ## Recoverable
11
+ t.string :reset_password_token
12
+ t.datetime :reset_password_sent_at
13
+
14
+ ## Rememberable
15
+ t.datetime :remember_created_at
16
+
17
+ ## Trackable
18
+ # t.integer :sign_in_count, default: 0, null: false
19
+ # t.datetime :current_sign_in_at
20
+ # t.datetime :last_sign_in_at
21
+ # t.string :current_sign_in_ip
22
+ # t.string :last_sign_in_ip
23
+
24
+ ## Confirmable
25
+ # t.string :confirmation_token
26
+ # t.datetime :confirmed_at
27
+ # t.datetime :confirmation_sent_at
28
+ # t.string :unconfirmed_email # Only if using reconfirmable
29
+
30
+ ## Lockable
31
+ # t.integer :failed_attempts, default: 0, null: false # Only if lock strategy is :failed_attempts
32
+ # t.string :unlock_token # Only if unlock strategy is :email or :both
33
+ # t.datetime :locked_at
34
+
35
+
36
+ t.timestamps null: false
37
+ end
38
+
39
+ add_index :phcdevworks_accounts_users, :email, unique: true
40
+ add_index :phcdevworks_accounts_users, :reset_password_token, unique: true
41
+ # add_index :phcdevworks_accounts_users, :confirmation_token, unique: true
42
+ # add_index :phcdevworks_accounts_users, :unlock_token, unique: true
43
+ end
44
+ end
@@ -0,0 +1,15 @@
1
+ class AddUserinfoToUsers < ActiveRecord::Migration[6.0]
2
+ def change
3
+
4
+ add_column :phcdevworks_accounts_users, :firstname, :string
5
+ add_column :phcdevworks_accounts_users, :lastname, :string
6
+ add_column :phcdevworks_accounts_users, :username, :string
7
+ add_column :phcdevworks_accounts_users, :org_id, :string
8
+
9
+ add_index :phcdevworks_accounts_users, :firstname
10
+ add_index :phcdevworks_accounts_users, :lastname
11
+ add_index :phcdevworks_accounts_users, :username, unique: true
12
+ add_index :phcdevworks_accounts_users, :org_id, unique: true
13
+
14
+ end
15
+ end
@@ -0,0 +1,7 @@
1
+ class AddRoleToUsers < ActiveRecord::Migration[6.0]
2
+ def change
3
+
4
+ add_column :phcdevworks_accounts_users, :role, :integer
5
+
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ class AddTermsToUsers < ActiveRecord::Migration[6.0]
2
+ def change
3
+
4
+ add_column :phcdevworks_accounts_users, :terms_of_service, :boolean
5
+
6
+ end
7
+ end
@@ -0,0 +1,35 @@
1
+ module PhcdevworksAccounts
2
+ class Engine < ::Rails::Engine
3
+
4
+ # Load Theme Dependencies
5
+ require "phcthemes_admin_panel_pack"
6
+ require "phcthemes_web_theme_pack"
7
+
8
+ # Load Helper Dependencies
9
+ require "phcdevworks_active_menus"
10
+ require "phcdevworks_notifications"
11
+ require "phcdevworks_titleseo"
12
+
13
+ # Frontend Dependencies
14
+ require 'gravtastic'
15
+ require 'friendly_id'
16
+
17
+ # Security Dependencies
18
+ require 'devise'
19
+ require 'simple_token_authentication'
20
+
21
+ # Payment Dependencies
22
+ require 'activemerchant'
23
+
24
+ # Plugin Namespace
25
+ isolate_namespace PhcdevworksAccounts
26
+
27
+ # Load Requried Helper Files
28
+ config.to_prepare do
29
+ PhcdevworksActiveMenus::ApplicationController.helper(ApplicationHelper)
30
+ PhcdevworksNotifications::ApplicationController.helper(ApplicationHelper)
31
+ PhcdevworksTitleseo::ApplicationController.helper(ApplicationHelper)
32
+ end
33
+
34
+ end
35
+ end
@@ -0,0 +1,3 @@
1
+ module PhcdevworksAccounts
2
+ VERSION = '0.1.0'
3
+ end
@@ -0,0 +1,5 @@
1
+ require "phcdevworks_accounts/engine"
2
+
3
+ module PhcdevworksAccounts
4
+ # Your code goes here...
5
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :phcdevworks_accounts do
3
+ # # Task goes here
4
+ # end