kenn-userify 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Rakefile +1 -1
- data/app/controllers/userify/user_controller.rb +24 -6
- data/lib/userify/authentication.rb +2 -2
- metadata +1 -1
data/Rakefile
CHANGED
@@ -35,7 +35,7 @@ task :default => ['test:all', 'test:features']
|
|
35
35
|
|
36
36
|
gem_spec = Gem::Specification.new do |gem_spec|
|
37
37
|
gem_spec.name = "userify"
|
38
|
-
gem_spec.version = "0.1.
|
38
|
+
gem_spec.version = "0.1.6"
|
39
39
|
gem_spec.summary = "Super simple authentication system for Rails, using username, email and password."
|
40
40
|
gem_spec.email = "kenn.ejima <at> gmail.com"
|
41
41
|
gem_spec.homepage = "http://github.com/kenn/userify"
|
@@ -34,6 +34,7 @@ class Userify::UserController < ApplicationController
|
|
34
34
|
case request.method
|
35
35
|
|
36
36
|
when :get
|
37
|
+
store_location(true)
|
37
38
|
render :template => 'user/signin'
|
38
39
|
|
39
40
|
when :post
|
@@ -116,12 +117,29 @@ class Userify::UserController < ApplicationController
|
|
116
117
|
end
|
117
118
|
|
118
119
|
protected
|
119
|
-
def url_after_signup
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
def
|
124
|
-
|
120
|
+
def url_after_signup
|
121
|
+
root_url
|
122
|
+
end
|
123
|
+
|
124
|
+
def url_after_signin
|
125
|
+
root_url
|
126
|
+
end
|
127
|
+
|
128
|
+
def url_after_signout
|
129
|
+
return :back
|
130
|
+
end
|
131
|
+
|
132
|
+
def url_after_activate
|
133
|
+
root_url
|
134
|
+
end
|
135
|
+
|
136
|
+
def url_after_forgot
|
137
|
+
root_url
|
138
|
+
end
|
139
|
+
|
140
|
+
def url_after_reset
|
141
|
+
root_url
|
142
|
+
end
|
125
143
|
|
126
144
|
def assign_user_from_token
|
127
145
|
raise ActionController::Forbidden, "missing token" if params[:token].blank?
|
@@ -61,8 +61,8 @@ module Userify
|
|
61
61
|
redirect_to root_url
|
62
62
|
end
|
63
63
|
|
64
|
-
def store_location
|
65
|
-
session[:return_to] = request.request_uri if request.get?
|
64
|
+
def store_location(referer=false)
|
65
|
+
session[:return_to] = referer ? request.env["HTTP_REFERER"] : request.request_uri if request.get?
|
66
66
|
end
|
67
67
|
|
68
68
|
def deny_access(flash_message = nil, opts = {})
|