lib/aptible/rails/controller.rb in aptible-rails-0.4.4 vs lib/aptible/rails/controller.rb in aptible-rails-0.4.5
- old
+ new
@@ -7,11 +7,11 @@
module Controller
extend ActiveSupport::Concern
included do
helper_method :current_user, :current_organization, :user_url,
- :organization_url, :criterion_by_handle
+ :organization_url, :criterion_by_handle, :auth_url
end
def current_user
return unless current_user_url
@current_user ||= Aptible::Auth::User.find_by_url(current_user_url,
@@ -102,9 +102,15 @@
Aptible::Gridiron::Criterion.where(
handle: handle.to_s,
token: service_token,
organization: current_organization
).first
+ end
+
+ def auth_url(path = '/', params = {})
+ uri = URI.join(Aptible::Auth.configuration.root_url, path)
+ uri.query = params.to_query if params
+ uri.to_s
end
end
end
end