janus 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/README.rdoc +1 -1
- data/VERSION +1 -1
- data/lib/generators/templates/passwords/edit.html.erb +1 -0
- data/lib/janus/controllers/confirmations_controller.rb +7 -1
- data/lib/janus/controllers/passwords_controller.rb +22 -2
- data/lib/janus/mailer.rb +1 -1
- data/lib/janus/routes.rb +1 -0
- data/test/functional/users/passwords_controller_test.rb +11 -1
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cfd15bc79e41899bc65c3eddc3042f11524e4616
|
4
|
+
data.tar.gz: f836a95402bb7371fe25d1af49cd5841b74bb6b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 15d3598d95a4e264a6087fea6244fe4937849c759dca34ffd0377a0764ef1b5a633bb98004e083e7a15136999d8535d71674e1944a9d913799af69ccb9601720
|
7
|
+
data.tar.gz: ee62d38fd4070283177a52176ac77525ad0994e991aaa0f579b2e9f559ad4ba38ae0a86c679c42f449825f2979c14cac43cb10b1410387d254a4309699e7983a
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/README.rdoc
CHANGED
@@ -25,7 +25,7 @@ As for the strategies and hooks:
|
|
25
25
|
to keep users signed in across top level domains;
|
26
26
|
- {TokenAuthenticatable}[http://rdoc.info/github/ysbaddaden/janus/Janus/Models/TokenAuthenticatable]
|
27
27
|
to auth users with unique tokens;
|
28
|
-
- {Confirmable}[http://rdoc.info/github/ysbaddaden/janus/Janus/Models/
|
28
|
+
- {Confirmable}[http://rdoc.info/github/ysbaddaden/janus/Janus/Models/Confirmable]
|
29
29
|
to have users confirm their emails upon registration;
|
30
30
|
- {Rememberable}[http://rdoc.info/github/ysbaddaden/janus/Janus/Models/Rememberable]
|
31
31
|
to keep users authentified;
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.8.
|
1
|
+
0.8.1
|
@@ -37,7 +37,7 @@ class Janus::ConfirmationsController < ApplicationController
|
|
37
37
|
self.resource = resource_class.find_for_database_authentication(params[resource_name])
|
38
38
|
|
39
39
|
if resource
|
40
|
-
|
40
|
+
deliver_confirmation_instructions
|
41
41
|
|
42
42
|
respond_to do |format|
|
43
43
|
format.html { redirect_to root_url, :notice => t('flash.janus.confirmations.create.email_sent') }
|
@@ -55,4 +55,10 @@ class Janus::ConfirmationsController < ApplicationController
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
end
|
58
|
+
|
59
|
+
# Simple wrapper for Mailer#confirmation_instructions.deliver to
|
60
|
+
# allow customization of the email (eg: to pass additional data).
|
61
|
+
def deliver_confirmation_instructions
|
62
|
+
mailer_class.confirmation_instructions(resource).deliver
|
63
|
+
end
|
58
64
|
end
|
@@ -15,7 +15,7 @@ class Janus::PasswordsController < ApplicationController
|
|
15
15
|
|
16
16
|
if resource
|
17
17
|
resource.generate_reset_password_token!
|
18
|
-
|
18
|
+
deliver_reset_password_instructions
|
19
19
|
|
20
20
|
respond_to do |format|
|
21
21
|
format.html { redirect_to root_url, :notice => t('flash.janus.passwords.create.email_sent') }
|
@@ -44,7 +44,7 @@ class Janus::PasswordsController < ApplicationController
|
|
44
44
|
if resource
|
45
45
|
if resource.reset_password!(params[resource_name])
|
46
46
|
respond_to do |format|
|
47
|
-
format.html {
|
47
|
+
format.html { redirect_after_password_change(self.resource, :notice => t('flash.janus.passwords.update.password_updated')) }
|
48
48
|
format.any { head :ok }
|
49
49
|
end
|
50
50
|
else
|
@@ -60,4 +60,24 @@ class Janus::PasswordsController < ApplicationController
|
|
60
60
|
end
|
61
61
|
end
|
62
62
|
end
|
63
|
+
|
64
|
+
# Simple wrapper for Mailer#reset_password_instructions.deliver to
|
65
|
+
# allow customization of the email (eg: to pass additional data).
|
66
|
+
def deliver_reset_password_instructions
|
67
|
+
mailer_class.reset_password_instructions(resource).deliver
|
68
|
+
end
|
69
|
+
|
70
|
+
# Either redirects the user to after_password_change_url or to
|
71
|
+
# <tt>params[:return_to]</tt> if present.
|
72
|
+
def redirect_after_password_change(user, options = {})
|
73
|
+
if params[:return_to].present?
|
74
|
+
redirect_to params[:return_to], options
|
75
|
+
else
|
76
|
+
redirect_to after_password_change_url(user), options
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
def after_password_change_url(user)
|
81
|
+
root_url
|
82
|
+
end
|
63
83
|
end
|
data/lib/janus/mailer.rb
CHANGED
data/lib/janus/routes.rb
CHANGED
@@ -67,6 +67,7 @@ module ActionDispatch # :nodoc:
|
|
67
67
|
|
68
68
|
resource :confirmation, :only => [:show, :new, :create] if options[:confirmation]
|
69
69
|
resource :password, :except => [:index, :show, :destroy] if options[:password]
|
70
|
+
yield if block_given?
|
70
71
|
end
|
71
72
|
|
72
73
|
ActionController::Base.janus(singular)
|
@@ -73,7 +73,9 @@ class Users::PasswordsControllerTest < ActionController::TestCase
|
|
73
73
|
test "should update" do
|
74
74
|
users(:julien).generate_reset_password_token!
|
75
75
|
|
76
|
-
put :update, :user => @attributes.merge(
|
76
|
+
put :update, :user => @attributes.merge(
|
77
|
+
:reset_password_token => users(:julien).reset_password_token
|
78
|
+
)
|
77
79
|
assert_redirected_to root_url
|
78
80
|
assert flash[:notice]
|
79
81
|
|
@@ -128,4 +130,12 @@ class Users::PasswordsControllerTest < ActionController::TestCase
|
|
128
130
|
assert_redirected_to root_url
|
129
131
|
assert flash[:alert]
|
130
132
|
end
|
133
|
+
|
134
|
+
test "should redirect to specified URL" do
|
135
|
+
users(:julien).generate_reset_password_token!
|
136
|
+
user_params = @attributes.merge(:reset_password_token => users(:julien).reset_password_token)
|
137
|
+
|
138
|
+
put :update, :user => user_params, :return_to => 'http://example.com/some/path.html'
|
139
|
+
assert_redirected_to 'http://example.com/some/path.html'
|
140
|
+
end
|
131
141
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: janus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien Portalier
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
KVqCN//9bevjMk5OiMi9X3Wu/GtVWDwC6OTWFWKd54KgbuWlakO8LC1SMmStnCIF
|
31
31
|
W4qpyMWMZMcB4ZN/0mUVzY5xwrislBtsmQVUSw==
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2014-
|
33
|
+
date: 2014-02-07 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: addressable
|
@@ -302,7 +302,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
302
302
|
version: '0'
|
303
303
|
requirements: []
|
304
304
|
rubyforge_project:
|
305
|
-
rubygems_version: 2.
|
305
|
+
rubygems_version: 2.0.14
|
306
306
|
signing_key:
|
307
307
|
specification_version: 4
|
308
308
|
summary: Authentication engine for Ruby on Rails
|
metadata.gz.sig
CHANGED
Binary file
|