phcdevworks_accounts 3.1.2 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/users/omniauth_callbacks_controller.rb +1 -1
- data/app/controllers/users/registrations_controller.rb +57 -47
- data/app/models/phcdevworks_accounts/user.rb +4 -1
- data/app/views/layouts/phcdevworks_accounts/components/backend/sidebars/_side_menu.html.erb +1 -1
- data/app/views/users/registrations/new.html.erb +1 -1
- data/config/routes.rb +4 -3
- data/lib/phcdevworks_accounts/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b2093924da8575dc57bdaf811cddc71451d3878ce9792c59d0a6b8a664cda05d
|
4
|
+
data.tar.gz: bf612d14ae462d489c7037579097191518cf152acb9963359b64cb62ef7b3a69
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 866a2386fe6b0754a6c1d468136786bb34b17e7e1df03a961c33ed9f4e926babd06eec5c98a6cda3cacba07151e3bf128fb0a20ec64e7acec0ed418781dc7358
|
7
|
+
data.tar.gz: 4375a693a0ebb9e4e37c0936b70436d1159907d23ef36de386d32762199125fe62264e61c97da5874e234b8b9abbdfb9c4872eec31e192a0044ff0893e53237b
|
@@ -9,7 +9,7 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
|
9
9
|
# end
|
10
10
|
|
11
11
|
# More info at:
|
12
|
-
# https://github.com/
|
12
|
+
# https://github.com/heartcombo/devise#omniauth
|
13
13
|
|
14
14
|
# GET|POST /resource/auth/twitter
|
15
15
|
# def passthru
|
@@ -1,64 +1,74 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
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)}
|
4
7
|
|
5
|
-
|
6
|
-
|
8
|
+
# GET /resource/sign_up
|
9
|
+
# def new
|
10
|
+
# super
|
11
|
+
# end
|
7
12
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
13
|
+
# POST /resource
|
14
|
+
def create
|
15
|
+
super
|
16
|
+
end
|
12
17
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
18
|
+
# GET /resource/edit
|
19
|
+
# def edit
|
20
|
+
# super
|
21
|
+
# end
|
17
22
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
23
|
+
# PUT /resource
|
24
|
+
# def update
|
25
|
+
# super
|
26
|
+
# end
|
22
27
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
28
|
+
# DELETE /resource
|
29
|
+
# def destroy
|
30
|
+
# super
|
31
|
+
# end
|
27
32
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
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
|
32
41
|
|
33
|
-
|
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
|
42
|
+
# protected
|
41
43
|
|
42
|
-
|
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
|
43
48
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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
|
48
53
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
54
|
+
# The path used after sign up.
|
55
|
+
# def after_sign_up_path_for(resource)
|
56
|
+
# super(resource)
|
57
|
+
# end
|
53
58
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
59
|
+
# The path used after sign up for inactive accounts.
|
60
|
+
# def after_inactive_sign_up_path_for(resource)
|
61
|
+
# super(resource)
|
62
|
+
# end
|
58
63
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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
|
63
73
|
|
64
74
|
end
|
@@ -14,7 +14,10 @@ module PhcdevworksAccounts
|
|
14
14
|
|
15
15
|
# Include default devise modules. Others available are:
|
16
16
|
# :trackable, :confirmable, :lockable and :omniauthable
|
17
|
-
devise :database_authenticatable, :registerable, :recoverable, :rememberable,
|
17
|
+
devise :database_authenticatable, :registerable, :recoverable, :rememberable, :validatable, :timeoutable
|
18
|
+
|
19
|
+
# Validations
|
20
|
+
validates :username, :presence => true, :uniqueness => true
|
18
21
|
|
19
22
|
private
|
20
23
|
|
@@ -277,9 +277,9 @@
|
|
277
277
|
<!-- -PHC- Sidebar - Sidebar Navigation - PHCDevworks Core Modules -->
|
278
278
|
<% end %>
|
279
279
|
|
280
|
-
<li class="nav-header">Administration</li>
|
281
280
|
<% if current_user && current_user.admin? %>
|
282
281
|
<!-- -PHC- Sidebar - Sidebar Navigation - PHCAccounts Admin Options -->
|
282
|
+
<li class="nav-header">Administration</li>
|
283
283
|
<li class="has-sub">
|
284
284
|
<a href="javascript:;">
|
285
285
|
<b class="caret"></b>
|
@@ -67,7 +67,7 @@
|
|
67
67
|
<label class="control-label">Password Confirmation <span class="text-danger">*</span></label>
|
68
68
|
<div class="row m-b-15">
|
69
69
|
<div class="col-md-12">
|
70
|
-
<%= form.password_field :
|
70
|
+
<%= form.password_field :password_confirmation, autocomplete: "off", placeholder: "Confirm your Password", class: "form-control" %>
|
71
71
|
</div>
|
72
72
|
</div>
|
73
73
|
|
data/config/routes.rb
CHANGED
@@ -10,9 +10,10 @@ PhcdevworksAccounts::Engine.routes.draw do
|
|
10
10
|
match "/admin/user/:id", to: "admin/pages#user_profile", via: "get"
|
11
11
|
|
12
12
|
# User Routes
|
13
|
-
devise_for :users,
|
14
|
-
|
15
|
-
|
13
|
+
devise_for :users, class_name: "PhcdevworksAccounts::User",
|
14
|
+
module: :devise,
|
15
|
+
controllers: {
|
16
|
+
registrations: 'users/registrations'
|
16
17
|
}
|
17
18
|
|
18
19
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phcdevworks_accounts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- PHCDevworks
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-04-
|
11
|
+
date: 2021-04-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|