spree_auth 0.30.0.beta1 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spree_auth might be problematic. Click here for more details.
- data/README.md +2 -5
- data/app/controllers/checkout_controller_decorator.rb +19 -7
- data/app/controllers/orders_controller_decorator.rb +8 -4
- data/app/controllers/resource_controller_decorator.rb +1 -1
- data/app/controllers/spree/base_controller_decorator.rb +24 -3
- data/app/controllers/user_sessions_controller.rb +116 -0
- data/app/controllers/users_controller.rb +54 -0
- data/app/models/ability.rb +24 -1
- data/app/models/order_decorator.rb +8 -5
- data/app/models/spree_current_order_decorator.rb +8 -0
- data/app/models/user.rb +48 -15
- data/app/models/user_mailer.rb +12 -0
- data/app/models/user_session.rb +3 -0
- data/app/views/checkout/registration.html.erb +3 -2
- data/app/views/password_resets/edit.html.erb +12 -0
- data/app/views/password_resets/new.html.erb +13 -0
- data/app/views/shared/_error_messages.html.erb +10 -0
- data/app/views/shared/_flashes.html.erb +9 -0
- data/app/views/shared/_login_bar.html.erb +4 -4
- data/app/views/user_mailer/password_reset_instructions.erb +10 -0
- data/app/views/user_sessions/authorization_failure.html.erb +4 -0
- data/app/views/user_sessions/new.html.erb +9 -0
- data/app/views/users/edit.html.erb +11 -0
- data/app/views/users/new.html.erb +23 -0
- data/app/views/users/show.html.erb +46 -0
- data/config/routes.rb +18 -1
- data/db/sample/users.rb +53 -0
- data/lib/cancan/controller_additions.rb +60 -0
- data/lib/spree/auth_user.rb +5 -9
- data/lib/spree_auth.rb +2 -4
- data/lib/tasks/auth.rake +8 -0
- data/lib/tasks/install.rake +24 -0
- metadata +43 -32
- data/app/controllers/devise/sessions_controller_decorator.rb +0 -12
- data/app/views/devise/confirmations/new.html.erb +0 -12
- data/app/views/devise/mailer/confirmation_instructions.html.erb +0 -5
- data/app/views/devise/mailer/reset_password_instructions.html.erb +0 -8
- data/app/views/devise/mailer/unlock_instructions.html.erb +0 -7
- data/app/views/devise/passwords/edit.html.erb +0 -16
- data/app/views/devise/passwords/new.html.erb +0 -12
- data/app/views/devise/registrations/edit.html.erb +0 -25
- data/app/views/devise/registrations/new.html.erb +0 -22
- data/app/views/devise/sessions/new.html.erb +0 -20
- data/app/views/devise/shared/_links.erb +0 -19
- data/app/views/devise/unlocks/new.html.erb +0 -12
- data/lib/generators/spree_auth/install_generator.rb +0 -25
- data/lib/generators/templates/db/migrate/20100811003924_switch_to_devise.rb +0 -31
- data/lib/generators/templates/devise.rb +0 -146
@@ -1,31 +0,0 @@
|
|
1
|
-
class SwitchToDevise < ActiveRecord::Migration
|
2
|
-
def self.up
|
3
|
-
change_table(:users) do |t|
|
4
|
-
t.rename :crypted_password, :encrypted_password
|
5
|
-
t.rename :salt, :password_salt
|
6
|
-
t.rename :remember_token_expires_at, :remember_created_at
|
7
|
-
t.rename :persistence_token, :authentication_token
|
8
|
-
t.rename :single_access_token, :reset_password_token
|
9
|
-
t.remove :perishable_token
|
10
|
-
t.rename :login_count, :sign_in_count
|
11
|
-
t.remove :failed_login_count
|
12
|
-
t.remove :last_request_at
|
13
|
-
t.rename :current_login_at, :current_sign_in_at
|
14
|
-
t.rename :last_login_at, :last_sign_in_at
|
15
|
-
t.rename :current_login_ip, :current_sign_in_ip
|
16
|
-
t.rename :last_login_ip, :last_sign_in_ip
|
17
|
-
t.remove :login
|
18
|
-
t.remove :openid_identifier
|
19
|
-
t.remove :api_key
|
20
|
-
end
|
21
|
-
drop_table :open_id_authentication_associations
|
22
|
-
drop_table :open_id_authentication_nonces
|
23
|
-
|
24
|
-
add_index :users, :email, :unique => true
|
25
|
-
add_index :users, :reset_password_token, :unique => true
|
26
|
-
end
|
27
|
-
|
28
|
-
def self.down
|
29
|
-
# no going back!
|
30
|
-
end
|
31
|
-
end
|
@@ -1,146 +0,0 @@
|
|
1
|
-
# Use this hook to configure devise mailer, warden hooks and so forth. The first
|
2
|
-
# four configuration values can also be set straight in your models.
|
3
|
-
Devise.setup do |config|
|
4
|
-
# ==> Mailer Configuration
|
5
|
-
# Configure the e-mail address which will be shown in DeviseMailer.
|
6
|
-
config.mailer_sender = "please-change-me@config-initializers-devise.com"
|
7
|
-
|
8
|
-
# Configure the class responsible to send e-mails.
|
9
|
-
# config.mailer = "Devise::Mailer"
|
10
|
-
|
11
|
-
# ==> ORM configuration
|
12
|
-
# Load and configure the ORM. Supports :active_record (default) and
|
13
|
-
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
14
|
-
# available as additional gems.
|
15
|
-
require 'devise/orm/active_record'
|
16
|
-
|
17
|
-
# ==> Configuration for any authentication mechanism
|
18
|
-
# Configure which keys are used when authenticating an user. By default is
|
19
|
-
# just :email. You can configure it to use [:username, :subdomain], so for
|
20
|
-
# authenticating an user, both parameters are required. Remember that those
|
21
|
-
# parameters are used only when authenticating and not when retrieving from
|
22
|
-
# session. If you need permissions, you should implement that in a before filter.
|
23
|
-
# config.authentication_keys = [ :email ]
|
24
|
-
|
25
|
-
# Tell if authentication through request.params is enabled. True by default.
|
26
|
-
# config.params_authenticatable = true
|
27
|
-
|
28
|
-
# Tell if authentication through HTTP Basic Auth is enabled. True by default.
|
29
|
-
# config.http_authenticatable = true
|
30
|
-
|
31
|
-
# Set this to true to use Basic Auth for AJAX requests. True by default.
|
32
|
-
# config.http_authenticatable_on_xhr = true
|
33
|
-
|
34
|
-
# The realm used in Http Basic Authentication
|
35
|
-
# config.http_authentication_realm = "Application"
|
36
|
-
|
37
|
-
# ==> Configuration for :database_authenticatable
|
38
|
-
# Define which will be the encryption algorithm. Devise also supports encryptors
|
39
|
-
# from others authentication tools as :clearance_sha1, :authlogic_sha512 (then
|
40
|
-
# you should set stretches above to 20 for default behavior) and :restful_authentication_sha1
|
41
|
-
# (then you should set stretches to 10, and copy REST_AUTH_SITE_KEY to pepper)
|
42
|
-
config.encryptor = :bcrypt
|
43
|
-
|
44
|
-
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
45
|
-
# using other encryptors, it sets how many times you want the password re-encrypted.
|
46
|
-
config.stretches = 10
|
47
|
-
|
48
|
-
# Setup a pepper to generate the encrypted password.
|
49
|
-
config.pepper = <%= ActiveSupport::SecureRandom.hex(64).inspect %>
|
50
|
-
|
51
|
-
# ==> Configuration for :confirmable
|
52
|
-
# The time you want to give your user to confirm his account. During this time
|
53
|
-
# he will be able to access your application without confirming. Default is nil.
|
54
|
-
# When confirm_within is zero, the user won't be able to sign in without confirming.
|
55
|
-
# You can use this to let your user access some features of your application
|
56
|
-
# without confirming the account, but blocking it after a certain period
|
57
|
-
# (ie 2 days).
|
58
|
-
# config.confirm_within = 2.days
|
59
|
-
|
60
|
-
# ==> Configuration for :rememberable
|
61
|
-
# The time the user will be remembered without asking for credentials again.
|
62
|
-
# config.remember_for = 2.weeks
|
63
|
-
|
64
|
-
# If true, a valid remember token can be re-used between multiple browsers.
|
65
|
-
# config.remember_across_browsers = true
|
66
|
-
|
67
|
-
# If true, extends the user's remember period when remembered via cookie.
|
68
|
-
# config.extend_remember_period = false
|
69
|
-
|
70
|
-
# ==> Configuration for :validatable
|
71
|
-
# Range for password length
|
72
|
-
# config.password_length = 6..20
|
73
|
-
|
74
|
-
# Regex to use to validate the email address
|
75
|
-
# config.email_regexp = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
|
76
|
-
|
77
|
-
# ==> Configuration for :timeoutable
|
78
|
-
# The time you want to timeout the user session without activity. After this
|
79
|
-
# time the user will be asked for credentials again.
|
80
|
-
# config.timeout_in = 10.minutes
|
81
|
-
|
82
|
-
# ==> Configuration for :lockable
|
83
|
-
# Defines which strategy will be used to lock an account.
|
84
|
-
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
85
|
-
# :none = No lock strategy. You should handle locking by yourself.
|
86
|
-
# config.lock_strategy = :failed_attempts
|
87
|
-
|
88
|
-
# Defines which strategy will be used to unlock an account.
|
89
|
-
# :email = Sends an unlock link to the user email
|
90
|
-
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
91
|
-
# :both = Enables both strategies
|
92
|
-
# :none = No unlock strategy. You should handle unlocking by yourself.
|
93
|
-
# config.unlock_strategy = :both
|
94
|
-
|
95
|
-
# Number of authentication tries before locking an account if lock_strategy
|
96
|
-
# is failed attempts.
|
97
|
-
# config.maximum_attempts = 20
|
98
|
-
|
99
|
-
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
100
|
-
# config.unlock_in = 1.hour
|
101
|
-
|
102
|
-
# ==> Configuration for :token_authenticatable
|
103
|
-
# Defines name of the authentication token params key
|
104
|
-
# config.token_authentication_key = :auth_token
|
105
|
-
|
106
|
-
# ==> Scopes configuration
|
107
|
-
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
108
|
-
# "users/sessions/new". It's turned off by default because it's slower if you
|
109
|
-
# are using only default views.
|
110
|
-
# config.scoped_views = true
|
111
|
-
|
112
|
-
# Configure the default scope given to Warden. By default it's the first
|
113
|
-
# devise role declared in your routes.
|
114
|
-
# config.default_scope = :user
|
115
|
-
|
116
|
-
# Configure sign_out behavior.
|
117
|
-
# By default sign_out is scoped (i.e. /users/sign_out affects only :user scope).
|
118
|
-
# In case of sign_out_all_scopes set to true any logout action will sign out all active scopes.
|
119
|
-
# config.sign_out_all_scopes = false
|
120
|
-
|
121
|
-
# ==> Navigation configuration
|
122
|
-
# Lists the formats that should be treated as navigational. Formats like
|
123
|
-
# :html, should redirect to the sign in page when the user does not have
|
124
|
-
# access, but formats like :xml or :json, should return 401.
|
125
|
-
# If you have any extra navigational formats, like :iphone or :mobile, you
|
126
|
-
# should add them to the navigational formats lists. Default is [:html]
|
127
|
-
# config.navigational_formats = [:html, :iphone]
|
128
|
-
|
129
|
-
# ==> OAuth2
|
130
|
-
# Add a new OAuth2 provider. Check the README for more information on setting
|
131
|
-
# up on your models and hooks.
|
132
|
-
# config.oauth :github, 'APP_ID', 'APP_SECRET',
|
133
|
-
# :site => 'https://github.com/',
|
134
|
-
# :authorize_path => '/login/oauth/authorize',
|
135
|
-
# :access_token_path => '/login/oauth/access_token',
|
136
|
-
# :scope => %w(user public_repo)
|
137
|
-
|
138
|
-
# ==> Warden configuration
|
139
|
-
# If you want to use other strategies, that are not supported by Devise, or
|
140
|
-
# change the failure app, you can configure them inside the config.warden block.
|
141
|
-
#
|
142
|
-
# config.warden do |manager|
|
143
|
-
# manager.failure_app = AnotherApp
|
144
|
-
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
|
145
|
-
# end
|
146
|
-
end
|