Fingertips-authentication-needed-san 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -28,5 +28,15 @@ ApplicationController would look something like the following:
28
28
  end
29
29
  end
30
30
 
31
+ Then from your sessions controller redirect the user back to the page she
32
+ requested or the default one:
33
+
34
+ class SessionsController < ApplicationController
35
+ def create
36
+ # login code...
37
+ finish_authentication_needed! or redirect_to(root_url)
38
+ end
39
+ end
40
+
31
41
  The authorization-san plugin is available at:
32
42
  http://github.com/Fingertips/authorization-san
data/VERSION.yml CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
2
  :major: 1
3
3
  :minor: 1
4
- :patch: 0
4
+ :patch: 1
@@ -59,6 +59,16 @@ module AuthenticationNeededSan
59
59
  # Finish the after_authentication flow, which means the user will be
60
60
  # redirected ‘back’ to the page she originally requested _before_
61
61
  # authentication_needed! was called.
62
+ #
63
+ # This method returns +false+ if no authentication was needed, this way you
64
+ # can easily specify a default redirection:
65
+ #
66
+ # class SessionsController < ApplicationController
67
+ # def create
68
+ # # login code...
69
+ # finish_authentication_needed! or redirect_to(root_url)
70
+ # end
71
+ # end
62
72
  def finish_authentication_needed!
63
73
  if authentication_needed?
64
74
  flash.discard :after_authentication
data/rails/init.rb CHANGED
@@ -1,2 +1,2 @@
1
1
  require 'authentication_needed_san'
2
- ApplicationController.send(:include, AuthenticationNeededSan)
2
+ ActionController::Base.send(:include, AuthenticationNeededSan)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: Fingertips-authentication-needed-san
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran