phcdevworks_accounts 3.2.4 → 3.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +20 -20
- data/README.md +7 -7
- data/Rakefile +8 -8
- data/app/assets/config/phcdevworks_accounts_manifest.js +3 -3
- data/app/assets/stylesheets/phcdevworks_accounts/admin/pages.scss +3 -3
- data/app/assets/stylesheets/phcdevworks_accounts/application.scss +0 -0
- data/app/assets/stylesheets/phcdevworks_accounts/user/pages.scss +3 -3
- data/app/controllers/phcdevworks_accounts/admin/pages_controller.rb +25 -25
- data/app/controllers/phcdevworks_accounts/application_controller.rb +25 -25
- data/app/controllers/phcdevworks_accounts/user/pages_controller.rb +15 -15
- data/app/controllers/users/confirmations_controller.rb +30 -30
- data/app/controllers/users/omniauth_callbacks_controller.rb +30 -30
- data/app/controllers/users/passwords_controller.rb +34 -34
- data/app/controllers/users/registrations_controller.rb +74 -74
- data/app/controllers/users/sessions_controller.rb +27 -27
- data/app/controllers/users/unlocks_controller.rb +30 -30
- data/app/helpers/phcdevworks_accounts/admin/pages_helper.rb +4 -4
- data/app/helpers/phcdevworks_accounts/application_helper.rb +4 -4
- data/app/helpers/phcdevworks_accounts/user/pages_helper.rb +4 -4
- data/app/jobs/phcdevworks_accounts/application_job.rb +4 -4
- data/app/mailers/phcdevworks_accounts/application_mailer.rb +6 -6
- data/app/models/phcdevworks_accounts/application_record.rb +5 -5
- data/app/models/phcdevworks_accounts/user.rb +39 -39
- data/app/views/layouts/phcdevworks_accounts/application.html.erb +66 -66
- data/app/views/layouts/phcdevworks_accounts/application_full_width.html.erb +66 -66
- data/app/views/layouts/phcdevworks_accounts/application_no_sidebar.html.erb +59 -59
- data/app/views/layouts/phcdevworks_accounts/application_profile.html.erb +65 -65
- data/app/views/layouts/phcdevworks_accounts/components/backend/footer/_footer.html.erb +0 -0
- data/app/views/layouts/phcdevworks_accounts/components/backend/navigation/_top_menu.html.erb +0 -0
- data/app/views/layouts/phcdevworks_accounts/components/backend/sidebars/_side_menu.html.erb +0 -0
- data/app/views/layouts/phcdevworks_accounts/devise.html.erb +0 -0
- data/app/views/phcdevworks_accounts/admin/pages/components/_profile_header.html.erb +27 -27
- data/app/views/phcdevworks_accounts/admin/pages/dashboard.html.erb +0 -0
- data/app/views/phcdevworks_accounts/admin/pages/user_profile.html.erb +22 -22
- data/app/views/phcdevworks_accounts/admin/pages/users_list.html.erb +72 -72
- data/app/views/phcdevworks_accounts/user/pages/dashboard.html.erb +0 -0
- data/app/views/phcdevworks_accounts/user/pages/profile.html.erb +0 -0
- data/app/views/users/confirmations/new.html.erb +62 -62
- data/app/views/users/mailer/confirmation_instructions.html.erb +5 -5
- data/app/views/users/mailer/email_changed.html.erb +7 -7
- data/app/views/users/mailer/password_change.html.erb +3 -3
- data/app/views/users/mailer/reset_password_instructions.html.erb +8 -8
- data/app/views/users/mailer/unlock_instructions.html.erb +7 -7
- data/app/views/users/passwords/edit.html.erb +78 -78
- data/app/views/users/passwords/new.html.erb +65 -65
- data/app/views/users/registrations/edit.html.erb +101 -101
- data/app/views/users/registrations/new.html.erb +114 -114
- data/app/views/users/sessions/new.html.erb +86 -86
- data/app/views/users/shared/_links.html.erb +25 -25
- data/app/views/users/unlocks/new.html.erb +62 -62
- data/config/initializers/devise.rb +310 -310
- data/config/locales/devise.en.yml +65 -65
- data/config/routes.rb +19 -19
- data/config/spring.rb +1 -1
- data/db/migrate/20191012042035_devise_create_phcdevworks_accounts_users.rb +46 -46
- data/db/migrate/20191012060241_add_userinfo_to_users.rb +15 -15
- data/db/migrate/20191012060308_add_role_to_users.rb +7 -7
- data/db/migrate/20191012060324_add_tos_to_users.rb +7 -7
- data/db/migrate/20210407121952_add_customer_id_to_users.rb +7 -7
- data/db/migrate/20210425060053_add_subscription_id_to_users.rb +7 -7
- data/lib/phcdevworks_accounts/engine.rb +48 -48
- data/lib/phcdevworks_accounts/version.rb +3 -3
- data/lib/phcdevworks_accounts.rb +6 -6
- data/lib/tasks/phcdevworks_accounts_tasks.rake +4 -4
- metadata +31 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e11485c19bbbf3268c31725e7631e1abf76febfb2f1513a651725f32ec791cc5
|
4
|
+
data.tar.gz: 4caa038a3d7c6a824f9bd954c87a9f651d45b1b16d834730f80ed9584293131a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e4f8606133e92ba882948760da95fc6304292a93a72e5f7c7b4fa6cff04f0086c13b5e5fd66f3e601fdb6e96ba8d2913997e83361aa67bdfb0313c6fcc9b3db
|
7
|
+
data.tar.gz: cb6282ae4607cb9a1febdca530afbd28e76da69f676d2833eb4735b83f99abe39a128a357126207677d15bcdf67e0fc981e8ce3114bb379beee7e8288318d3fa
|
data/MIT-LICENSE
CHANGED
@@ -1,20 +1,20 @@
|
|
1
|
-
Copyright 2020 BradPotts
|
2
|
-
|
3
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
-
a copy of this software and associated documentation files (the
|
5
|
-
"Software"), to deal in the Software without restriction, including
|
6
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
-
permit persons to whom the Software is furnished to do so, subject to
|
9
|
-
the following conditions:
|
10
|
-
|
11
|
-
The above copyright notice and this permission notice shall be
|
12
|
-
included in all copies or substantial portions of the Software.
|
13
|
-
|
14
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
1
|
+
Copyright 2020 BradPotts
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
#### PHCDevworks Accounts
|
2
|
-
|
3
|
-
Rails devise based user accounts and administration engine.
|
4
|
-
|
5
|
-
- Using Devise for Authentication
|
6
|
-
- Extra user information built in
|
7
|
-
- Custom login views included
|
1
|
+
#### PHCDevworks Accounts [![Gem Version](https://badge.fury.io/rb/phcdevworks_accounts.svg)](https://badge.fury.io/rb/phcdevworks_accounts)
|
2
|
+
|
3
|
+
Rails devise based user accounts and administration engine.
|
4
|
+
|
5
|
+
- Using Devise for Authentication
|
6
|
+
- Extra user information built in
|
7
|
+
- Custom login views included
|
data/Rakefile
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
require "bundler/setup"
|
2
|
-
|
3
|
-
APP_RAKEFILE = File.expand_path("spec/test_app/Rakefile", __dir__)
|
4
|
-
load "rails/tasks/engine.rake"
|
5
|
-
|
6
|
-
load "rails/tasks/statistics.rake"
|
7
|
-
|
8
|
-
require "bundler/gem_tasks"
|
1
|
+
require "bundler/setup"
|
2
|
+
|
3
|
+
APP_RAKEFILE = File.expand_path("spec/test_app/Rakefile", __dir__)
|
4
|
+
load "rails/tasks/engine.rake"
|
5
|
+
|
6
|
+
load "rails/tasks/statistics.rake"
|
7
|
+
|
8
|
+
require "bundler/gem_tasks"
|
@@ -1,3 +1,3 @@
|
|
1
|
-
//= link_directory ../stylesheets/phcdevworks_accounts .scss
|
2
|
-
//= link phcthemes_admin_panel_pack_coloradmin.css
|
3
|
-
//= link phcthemes_admin_panel_pack_coloradmin.js
|
1
|
+
//= link_directory ../stylesheets/phcdevworks_accounts .scss
|
2
|
+
//= link phcthemes_admin_panel_pack_coloradmin.css
|
3
|
+
//= link phcthemes_admin_panel_pack_coloradmin.js
|
@@ -1,3 +1,3 @@
|
|
1
|
-
// Place all the styles related to the admin/pages controller here.
|
2
|
-
// They will automatically be included in application.css.
|
3
|
-
// You can use Sass (SCSS) here: https://sass-lang.com/
|
1
|
+
// Place all the styles related to the admin/pages controller here.
|
2
|
+
// They will automatically be included in application.css.
|
3
|
+
// You can use Sass (SCSS) here: https://sass-lang.com/
|
File without changes
|
@@ -1,3 +1,3 @@
|
|
1
|
-
// Place all the styles related to the user/pages controller here.
|
2
|
-
// They will automatically be included in application.css.
|
3
|
-
// You can use Sass (SCSS) here: https://sass-lang.com/
|
1
|
+
// Place all the styles related to the user/pages controller here.
|
2
|
+
// They will automatically be included in application.css.
|
3
|
+
// You can use Sass (SCSS) here: https://sass-lang.com/
|
@@ -1,25 +1,25 @@
|
|
1
|
-
require_dependency "phcdevworks_accounts/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksAccounts
|
4
|
-
class Admin::PagesController < ApplicationController
|
5
|
-
|
6
|
-
# Filters
|
7
|
-
include PhcdevworksCore::PhcdevworksPluginsHelper
|
8
|
-
before_action :phcdevworks_accounts_admin_only
|
9
|
-
layout "phcdevworks_accounts/application_profile", :only => [ :user_profile ]
|
10
|
-
|
11
|
-
# Account Admin
|
12
|
-
def dashboard
|
13
|
-
end
|
14
|
-
|
15
|
-
# User Admin
|
16
|
-
def users_list
|
17
|
-
@admin_users = User.all
|
18
|
-
end
|
19
|
-
|
20
|
-
def user_profile
|
21
|
-
@admin_user = User.find_by_id(params[:id])
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
1
|
+
require_dependency "phcdevworks_accounts/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksAccounts
|
4
|
+
class Admin::PagesController < ApplicationController
|
5
|
+
|
6
|
+
# Filters
|
7
|
+
include PhcdevworksCore::PhcdevworksPluginsHelper
|
8
|
+
before_action :phcdevworks_accounts_admin_only
|
9
|
+
layout "phcdevworks_accounts/application_profile", :only => [ :user_profile ]
|
10
|
+
|
11
|
+
# Account Admin
|
12
|
+
def dashboard
|
13
|
+
end
|
14
|
+
|
15
|
+
# User Admin
|
16
|
+
def users_list
|
17
|
+
@admin_users = User.all
|
18
|
+
end
|
19
|
+
|
20
|
+
def user_profile
|
21
|
+
@admin_user = User.find_by_id(params[:id])
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -1,25 +1,25 @@
|
|
1
|
-
module PhcdevworksAccounts
|
2
|
-
class ApplicationController < ActionController::Base
|
3
|
-
|
4
|
-
# Devise Filter
|
5
|
-
before_action :phcdevworks_accounts_permitted_parameters, if: :devise_controller?
|
6
|
-
|
7
|
-
# Security Filters
|
8
|
-
protect_from_forgery with: :exception
|
9
|
-
|
10
|
-
# Load Requried Helper Files
|
11
|
-
helper PhcdevworksActiveMenus::Engine.helpers
|
12
|
-
helper PhcdevworksNotifications::Engine.helpers
|
13
|
-
helper PhcdevworksTitleseo::Engine.helpers
|
14
|
-
|
15
|
-
private
|
16
|
-
|
17
|
-
# Whitelist Additional Fields
|
18
|
-
def phcdevworks_accounts_permitted_parameters
|
19
|
-
added_attrs = [:username, :firstname, :lastname, :email, :terms_of_service, :payments_customer_id, :payments_subscription_id, :payments_plan_id, :password, :password_confirmation, :remember_me]
|
20
|
-
devise_parameter_sanitizer.permit :sign_up, keys: added_attrs
|
21
|
-
devise_parameter_sanitizer.permit :account_update, keys: added_attrs
|
22
|
-
end
|
23
|
-
|
24
|
-
end
|
25
|
-
end
|
1
|
+
module PhcdevworksAccounts
|
2
|
+
class ApplicationController < ActionController::Base
|
3
|
+
|
4
|
+
# Devise Filter
|
5
|
+
before_action :phcdevworks_accounts_permitted_parameters, if: :devise_controller?
|
6
|
+
|
7
|
+
# Security Filters
|
8
|
+
protect_from_forgery with: :exception
|
9
|
+
|
10
|
+
# Load Requried Helper Files
|
11
|
+
helper PhcdevworksActiveMenus::Engine.helpers
|
12
|
+
helper PhcdevworksNotifications::Engine.helpers
|
13
|
+
helper PhcdevworksTitleseo::Engine.helpers
|
14
|
+
|
15
|
+
private
|
16
|
+
|
17
|
+
# Whitelist Additional Fields
|
18
|
+
def phcdevworks_accounts_permitted_parameters
|
19
|
+
added_attrs = [:username, :firstname, :lastname, :email, :terms_of_service, :payments_customer_id, :payments_subscription_id, :payments_plan_id, :password, :password_confirmation, :remember_me]
|
20
|
+
devise_parameter_sanitizer.permit :sign_up, keys: added_attrs
|
21
|
+
devise_parameter_sanitizer.permit :account_update, keys: added_attrs
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
@@ -1,15 +1,15 @@
|
|
1
|
-
require_dependency "phcdevworks_accounts/application_controller"
|
2
|
-
|
3
|
-
module PhcdevworksAccounts
|
4
|
-
class User::PagesController < ApplicationController
|
5
|
-
|
6
|
-
# Security Filters
|
7
|
-
before_action :authenticate_user!
|
8
|
-
|
9
|
-
# Pages - User
|
10
|
-
def profile
|
11
|
-
@user_profile = User.find_by_id(params[:id])
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|
1
|
+
require_dependency "phcdevworks_accounts/application_controller"
|
2
|
+
|
3
|
+
module PhcdevworksAccounts
|
4
|
+
class User::PagesController < ApplicationController
|
5
|
+
|
6
|
+
# Security Filters
|
7
|
+
before_action :authenticate_user!
|
8
|
+
|
9
|
+
# Pages - User
|
10
|
+
def profile
|
11
|
+
@user_profile = User.find_by_id(params[:id])
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
@@ -1,30 +1,30 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Users::ConfirmationsController < Devise::ConfirmationsController
|
4
|
-
# GET /resource/confirmation/new
|
5
|
-
# def new
|
6
|
-
# super
|
7
|
-
# end
|
8
|
-
|
9
|
-
# POST /resource/confirmation
|
10
|
-
# def create
|
11
|
-
# super
|
12
|
-
# end
|
13
|
-
|
14
|
-
# GET /resource/confirmation?confirmation_token=abcdef
|
15
|
-
# def show
|
16
|
-
# super
|
17
|
-
# end
|
18
|
-
|
19
|
-
# protected
|
20
|
-
|
21
|
-
# The path used after resending confirmation instructions.
|
22
|
-
# def after_resending_confirmation_instructions_path_for(resource_name)
|
23
|
-
# super(resource_name)
|
24
|
-
# end
|
25
|
-
|
26
|
-
# The path used after confirmation.
|
27
|
-
# def after_confirmation_path_for(resource_name, resource)
|
28
|
-
# super(resource_name, resource)
|
29
|
-
# end
|
30
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Users::ConfirmationsController < Devise::ConfirmationsController
|
4
|
+
# GET /resource/confirmation/new
|
5
|
+
# def new
|
6
|
+
# super
|
7
|
+
# end
|
8
|
+
|
9
|
+
# POST /resource/confirmation
|
10
|
+
# def create
|
11
|
+
# super
|
12
|
+
# end
|
13
|
+
|
14
|
+
# GET /resource/confirmation?confirmation_token=abcdef
|
15
|
+
# def show
|
16
|
+
# super
|
17
|
+
# end
|
18
|
+
|
19
|
+
# protected
|
20
|
+
|
21
|
+
# The path used after resending confirmation instructions.
|
22
|
+
# def after_resending_confirmation_instructions_path_for(resource_name)
|
23
|
+
# super(resource_name)
|
24
|
+
# end
|
25
|
+
|
26
|
+
# The path used after confirmation.
|
27
|
+
# def after_confirmation_path_for(resource_name, resource)
|
28
|
+
# super(resource_name, resource)
|
29
|
+
# end
|
30
|
+
end
|
@@ -1,30 +1,30 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
4
|
-
# You should configure your model like this:
|
5
|
-
# devise :omniauthable, omniauth_providers: [:twitter]
|
6
|
-
|
7
|
-
# You should also create an action method in this controller like this:
|
8
|
-
# def twitter
|
9
|
-
# end
|
10
|
-
|
11
|
-
# More info at:
|
12
|
-
# https://github.com/heartcombo/devise#omniauth
|
13
|
-
|
14
|
-
# GET|POST /resource/auth/twitter
|
15
|
-
# def passthru
|
16
|
-
# super
|
17
|
-
# end
|
18
|
-
|
19
|
-
# GET|POST /users/auth/twitter/callback
|
20
|
-
# def failure
|
21
|
-
# super
|
22
|
-
# end
|
23
|
-
|
24
|
-
# protected
|
25
|
-
|
26
|
-
# The path used when OmniAuth fails
|
27
|
-
# def after_omniauth_failure_path_for(scope)
|
28
|
-
# super(scope)
|
29
|
-
# end
|
30
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
4
|
+
# You should configure your model like this:
|
5
|
+
# devise :omniauthable, omniauth_providers: [:twitter]
|
6
|
+
|
7
|
+
# You should also create an action method in this controller like this:
|
8
|
+
# def twitter
|
9
|
+
# end
|
10
|
+
|
11
|
+
# More info at:
|
12
|
+
# https://github.com/heartcombo/devise#omniauth
|
13
|
+
|
14
|
+
# GET|POST /resource/auth/twitter
|
15
|
+
# def passthru
|
16
|
+
# super
|
17
|
+
# end
|
18
|
+
|
19
|
+
# GET|POST /users/auth/twitter/callback
|
20
|
+
# def failure
|
21
|
+
# super
|
22
|
+
# end
|
23
|
+
|
24
|
+
# protected
|
25
|
+
|
26
|
+
# The path used when OmniAuth fails
|
27
|
+
# def after_omniauth_failure_path_for(scope)
|
28
|
+
# super(scope)
|
29
|
+
# end
|
30
|
+
end
|
@@ -1,34 +1,34 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Users::PasswordsController < Devise::PasswordsController
|
4
|
-
# GET /resource/password/new
|
5
|
-
# def new
|
6
|
-
# super
|
7
|
-
# end
|
8
|
-
|
9
|
-
# POST /resource/password
|
10
|
-
# def create
|
11
|
-
# super
|
12
|
-
# end
|
13
|
-
|
14
|
-
# GET /resource/password/edit?reset_password_token=abcdef
|
15
|
-
# def edit
|
16
|
-
# super
|
17
|
-
# end
|
18
|
-
|
19
|
-
# PUT /resource/password
|
20
|
-
# def update
|
21
|
-
# super
|
22
|
-
# end
|
23
|
-
|
24
|
-
# protected
|
25
|
-
|
26
|
-
# def after_resetting_password_path_for(resource)
|
27
|
-
# super(resource)
|
28
|
-
# end
|
29
|
-
|
30
|
-
# The path used after sending reset password instructions
|
31
|
-
# def after_sending_reset_password_instructions_path_for(resource_name)
|
32
|
-
# super(resource_name)
|
33
|
-
# end
|
34
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Users::PasswordsController < Devise::PasswordsController
|
4
|
+
# GET /resource/password/new
|
5
|
+
# def new
|
6
|
+
# super
|
7
|
+
# end
|
8
|
+
|
9
|
+
# POST /resource/password
|
10
|
+
# def create
|
11
|
+
# super
|
12
|
+
# end
|
13
|
+
|
14
|
+
# GET /resource/password/edit?reset_password_token=abcdef
|
15
|
+
# def edit
|
16
|
+
# super
|
17
|
+
# end
|
18
|
+
|
19
|
+
# PUT /resource/password
|
20
|
+
# def update
|
21
|
+
# super
|
22
|
+
# end
|
23
|
+
|
24
|
+
# protected
|
25
|
+
|
26
|
+
# def after_resetting_password_path_for(resource)
|
27
|
+
# super(resource)
|
28
|
+
# end
|
29
|
+
|
30
|
+
# The path used after sending reset password instructions
|
31
|
+
# def after_sending_reset_password_instructions_path_for(resource_name)
|
32
|
+
# super(resource_name)
|
33
|
+
# end
|
34
|
+
end
|
@@ -1,74 +1,74 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Users::RegistrationsController < Devise::RegistrationsController
|
4
|
-
# before_action :configure_sign_up_params, only: [:create]
|
5
|
-
# before_action :configure_account_update_params, only: [:update]
|
6
|
-
after_action :phcdevworks_accounts_payments_add_customer, :only => :create, if: -> {defined?(PhcdevworksAccountsStripe)}
|
7
|
-
|
8
|
-
# GET /resource/sign_up
|
9
|
-
# def new
|
10
|
-
# super
|
11
|
-
# end
|
12
|
-
|
13
|
-
# POST /resource
|
14
|
-
def create
|
15
|
-
super
|
16
|
-
end
|
17
|
-
|
18
|
-
# GET /resource/edit
|
19
|
-
# def edit
|
20
|
-
# super
|
21
|
-
# end
|
22
|
-
|
23
|
-
# PUT /resource
|
24
|
-
# def update
|
25
|
-
# super
|
26
|
-
# end
|
27
|
-
|
28
|
-
# DELETE /resource
|
29
|
-
# def destroy
|
30
|
-
# super
|
31
|
-
# end
|
32
|
-
|
33
|
-
# GET /resource/cancel
|
34
|
-
# Forces the session data which is usually expired after sign
|
35
|
-
# in to be expired now. This is useful if the user wants to
|
36
|
-
# cancel oauth signing in/up in the middle of the process,
|
37
|
-
# removing all OAuth session data.
|
38
|
-
# def cancel
|
39
|
-
# super
|
40
|
-
# end
|
41
|
-
|
42
|
-
# protected
|
43
|
-
|
44
|
-
# If you have extra params to permit, append them to the sanitizer.
|
45
|
-
# def configure_sign_up_params
|
46
|
-
# devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])
|
47
|
-
# end
|
48
|
-
|
49
|
-
# If you have extra params to permit, append them to the sanitizer.
|
50
|
-
# def configure_account_update_params
|
51
|
-
# devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
|
52
|
-
# end
|
53
|
-
|
54
|
-
# The path used after sign up.
|
55
|
-
# def after_sign_up_path_for(resource)
|
56
|
-
# super(resource)
|
57
|
-
# end
|
58
|
-
|
59
|
-
# The path used after sign up for inactive accounts.
|
60
|
-
# def after_inactive_sign_up_path_for(resource)
|
61
|
-
# super(resource)
|
62
|
-
# end
|
63
|
-
|
64
|
-
def phcdevworks_accounts_payments_add_customer
|
65
|
-
if resource.valid?
|
66
|
-
phcdevworks_accounts_customer = Stripe::Customer.create({
|
67
|
-
email: current_user.email, name: current_user.firstname + " " + current_user.lastname
|
68
|
-
})
|
69
|
-
@user.payments_customer_id = phcdevworks_accounts_customer.id
|
70
|
-
@user.save
|
71
|
-
end
|
72
|
-
end
|
73
|
-
|
74
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Users::RegistrationsController < Devise::RegistrationsController
|
4
|
+
# before_action :configure_sign_up_params, only: [:create]
|
5
|
+
# before_action :configure_account_update_params, only: [:update]
|
6
|
+
after_action :phcdevworks_accounts_payments_add_customer, :only => :create, if: -> {defined?(PhcdevworksAccountsStripe)}
|
7
|
+
|
8
|
+
# GET /resource/sign_up
|
9
|
+
# def new
|
10
|
+
# super
|
11
|
+
# end
|
12
|
+
|
13
|
+
# POST /resource
|
14
|
+
def create
|
15
|
+
super
|
16
|
+
end
|
17
|
+
|
18
|
+
# GET /resource/edit
|
19
|
+
# def edit
|
20
|
+
# super
|
21
|
+
# end
|
22
|
+
|
23
|
+
# PUT /resource
|
24
|
+
# def update
|
25
|
+
# super
|
26
|
+
# end
|
27
|
+
|
28
|
+
# DELETE /resource
|
29
|
+
# def destroy
|
30
|
+
# super
|
31
|
+
# end
|
32
|
+
|
33
|
+
# GET /resource/cancel
|
34
|
+
# Forces the session data which is usually expired after sign
|
35
|
+
# in to be expired now. This is useful if the user wants to
|
36
|
+
# cancel oauth signing in/up in the middle of the process,
|
37
|
+
# removing all OAuth session data.
|
38
|
+
# def cancel
|
39
|
+
# super
|
40
|
+
# end
|
41
|
+
|
42
|
+
# protected
|
43
|
+
|
44
|
+
# If you have extra params to permit, append them to the sanitizer.
|
45
|
+
# def configure_sign_up_params
|
46
|
+
# devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute])
|
47
|
+
# end
|
48
|
+
|
49
|
+
# If you have extra params to permit, append them to the sanitizer.
|
50
|
+
# def configure_account_update_params
|
51
|
+
# devise_parameter_sanitizer.permit(:account_update, keys: [:attribute])
|
52
|
+
# end
|
53
|
+
|
54
|
+
# The path used after sign up.
|
55
|
+
# def after_sign_up_path_for(resource)
|
56
|
+
# super(resource)
|
57
|
+
# end
|
58
|
+
|
59
|
+
# The path used after sign up for inactive accounts.
|
60
|
+
# def after_inactive_sign_up_path_for(resource)
|
61
|
+
# super(resource)
|
62
|
+
# end
|
63
|
+
|
64
|
+
def phcdevworks_accounts_payments_add_customer
|
65
|
+
if resource.valid?
|
66
|
+
phcdevworks_accounts_customer = Stripe::Customer.create({
|
67
|
+
email: current_user.email, name: current_user.firstname + " " + current_user.lastname
|
68
|
+
})
|
69
|
+
@user.payments_customer_id = phcdevworks_accounts_customer.id
|
70
|
+
@user.save
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
end
|
@@ -1,27 +1,27 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
class Users::SessionsController < Devise::SessionsController
|
4
|
-
# before_action :configure_sign_in_params, only: [:create]
|
5
|
-
|
6
|
-
# GET /resource/sign_in
|
7
|
-
# def new
|
8
|
-
# super
|
9
|
-
# end
|
10
|
-
|
11
|
-
# POST /resource/sign_in
|
12
|
-
# def create
|
13
|
-
# super
|
14
|
-
# end
|
15
|
-
|
16
|
-
# DELETE /resource/sign_out
|
17
|
-
# def destroy
|
18
|
-
# super
|
19
|
-
# end
|
20
|
-
|
21
|
-
# protected
|
22
|
-
|
23
|
-
# If you have extra params to permit, append them to the sanitizer.
|
24
|
-
# def configure_sign_in_params
|
25
|
-
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
|
26
|
-
# end
|
27
|
-
end
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
class Users::SessionsController < Devise::SessionsController
|
4
|
+
# before_action :configure_sign_in_params, only: [:create]
|
5
|
+
|
6
|
+
# GET /resource/sign_in
|
7
|
+
# def new
|
8
|
+
# super
|
9
|
+
# end
|
10
|
+
|
11
|
+
# POST /resource/sign_in
|
12
|
+
# def create
|
13
|
+
# super
|
14
|
+
# end
|
15
|
+
|
16
|
+
# DELETE /resource/sign_out
|
17
|
+
# def destroy
|
18
|
+
# super
|
19
|
+
# end
|
20
|
+
|
21
|
+
# protected
|
22
|
+
|
23
|
+
# If you have extra params to permit, append them to the sanitizer.
|
24
|
+
# def configure_sign_in_params
|
25
|
+
# devise_parameter_sanitizer.permit(:sign_in, keys: [:attribute])
|
26
|
+
# end
|
27
|
+
end
|