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