auto_auth 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/generators/auto_auth/install_generator.rb +1 -0
- data/lib/generators/auto_auth/version.rb +1 -1
- data/lib/generators/templates/controllers/concerns/authentication.rb +1 -1
- data/lib/generators/templates/controllers/passwords_controller.rb +1 -1
- data/lib/generators/templates/controllers/registrations_controller.rb +3 -3
- data/lib/generators/templates/controllers/sessions_controller.rb +3 -3
- data/lib/generators/templates/views/sessions/new.html.erb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85ce13e747cbe28e3cb93bc71c8981fb1fb73b41
|
4
|
+
data.tar.gz: 688522f50e5398653b7857e37df8a9fb2fc01925
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4e18d54147130cdc07a94e66642e2bff8e661ec19657c8422dd046ba1121ae2cfffeb623319ed6d10220ff2c88bbf1eaf8acdd692c03aa98e896defe5d11d9b
|
7
|
+
data.tar.gz: 6d4517723ea858f7f53e6a3beecbe8c7024eebdec3e5374eeafbd04c75d20fbc33d9ff3a80039bd0a8e863c9535402b6ac6420d875739f807f04d348199b9304
|
@@ -16,7 +16,7 @@ class PasswordsController < ApplicationController
|
|
16
16
|
if <%= identity_model %> = <%= identity_model_class %>.find_by(email: email)
|
17
17
|
<%= identity_mailer_class %>.reset_password(<%= identity_model %>).deliver
|
18
18
|
end
|
19
|
-
redirect_to(root_path, notice: t(:'
|
19
|
+
redirect_to(root_path, notice: t(:'auto_auth.passwords.reset_instructions'))
|
20
20
|
end
|
21
21
|
|
22
22
|
def update
|
@@ -4,7 +4,7 @@ class RegistrationsController < ApplicationController
|
|
4
4
|
|
5
5
|
skip_before_action :authenticate!, only: [:new, :confirm, :create]
|
6
6
|
before_action :redirect_authenticated, only: [:new, :create]
|
7
|
-
before_action :
|
7
|
+
before_action :setup_<%= identity_model %>, only: [:confirm]
|
8
8
|
|
9
9
|
def new
|
10
10
|
@registration = Registration.new
|
@@ -12,7 +12,7 @@ class RegistrationsController < ApplicationController
|
|
12
12
|
|
13
13
|
def confirm
|
14
14
|
@<%= identity_model %>.confirm!
|
15
|
-
redirect_to(root_path, notice: t(:'auto_auth.
|
15
|
+
redirect_to(root_path, notice: t(:'auto_auth.registrations.confirmed'))
|
16
16
|
end
|
17
17
|
|
18
18
|
def create
|
@@ -30,7 +30,7 @@ class RegistrationsController < ApplicationController
|
|
30
30
|
private
|
31
31
|
|
32
32
|
def setup_<%= identity_model %>
|
33
|
-
<%= identity_model_class %>.verify_signature!(
|
33
|
+
<%= identity_model_class %>.verify_signature!(<%= identity_model_class %>::EMAIL_CONFIRMATION_KEY, params.require(:email_confirmation_token)) do |record, expires_at|
|
34
34
|
if expires_at < Time.current
|
35
35
|
redirect_to(root_path, alert: t(:'auto_auth.registrations.expired'))
|
36
36
|
else
|
@@ -7,9 +7,9 @@ class SessionsController < ApplicationController
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def create
|
10
|
-
|
11
|
-
if
|
12
|
-
session[:<%= "#{domain_model.underscore}_id" %>] =
|
10
|
+
<%= identity_model %> = <%= identity_model.classify %>.find_by(email: params[:session][:email])
|
11
|
+
if <%= identity_model %> && <%= identity_model %>.authenticate(params[:session].delete(:password))
|
12
|
+
session[:<%= "#{domain_model.underscore}_id" %>] = <%= identity_model %>.<%= "#{domain_model.underscore}_id" %>
|
13
13
|
redirect_to(after_sign_in_path, notice: t(:'auto_auth.sessions.signed_in'))
|
14
14
|
else
|
15
15
|
flash.now[:alert] = t(:'auto_auth.sessions.bad_combination')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auto_auth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Schneider
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|