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 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.5"
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; root_url; end
120
- def url_after_signin; root_url; end
121
- def url_after_signout; root_url; end
122
- def url_after_activate; root_url; end
123
- def url_after_forgot; root_url; end
124
- def url_after_reset; root_url; end
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 = {})
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kenn-userify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenn Ejima