Permalink
Browse files

added requested_url parameter to redirect url

  • Loading branch information...
1 parent e936204 commit b8fc5238278601336421c6608d4994536520755f @dereke committed Feb 3, 2012
Showing with 5 additions and 4 deletions.
  1. +2 −2 Gemfile.lock
  2. +2 −1 lib/simple-authorisation/sinatra.rb
  3. +1 −1 simple-authorisation.gemspec
View
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
- simple-authorisation (0.0.18)
+ simple-authorisation (0.0.19)
builder (~> 2.0)
sinatra (~> 1.3.0)
@@ -12,7 +12,7 @@ GEM
diff-lcs (1.1.2)
multi_json (1.0.3)
rack (1.3.2)
- rack-protection (1.1.4)
+ rack-protection (1.2.0)
rack
rack-test (0.6.0)
rack (>= 1.0)
@@ -1,3 +1,4 @@
+require 'cgi'
require 'sinatra/base'
module Sinatra
@@ -22,7 +23,7 @@ def self.registered(app)
user = request_user.call
if user.is_a? settings.authorisation_anonymous_user_class
- redirect settings.authorisation_login
+ redirect settings.authorisation_login + "?requested_url=#{CGI.escape(request.fullpath)}"
else
redirect settings.authorisation_permission_denied
end
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
Gem::Specification.new do |s|
s.name = 'simple-authorisation'
- s.version = '0.0.18'
+ s.version = '0.0.19'
s.authors = ["Derek Ekins"]
s.description = 'Handles authorisation only'
s.summary = "simple-authorisation-#{s.version}"

0 comments on commit b8fc523

Please sign in to comment.