2010-06-13 10:39:20 +00:00
|
|
|
module Devise
|
|
|
|
class PathChecker
|
|
|
|
include Rails.application.routes.url_helpers
|
2010-06-13 10:40:40 +00:00
|
|
|
|
2010-07-16 06:40:21 +00:00
|
|
|
def self.default_url_options(*args)
|
|
|
|
ApplicationController.default_url_options(*args)
|
|
|
|
end
|
|
|
|
|
2010-06-13 10:39:20 +00:00
|
|
|
def initialize(env, scope)
|
2010-07-06 12:58:40 +00:00
|
|
|
@current_path = "/#{env["SCRIPT_NAME"]}/#{env["PATH_INFO"]}".squeeze("/")
|
|
|
|
@scope = scope
|
2010-06-13 10:39:20 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def signing_out?
|
2010-07-06 12:58:40 +00:00
|
|
|
@current_path == send("destroy_#{@scope}_session_path")
|
2010-06-13 10:39:20 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|