Skip to content
Browse files

Add debug

  • Loading branch information...
1 parent de35830 commit 233cc3c12da773095d8cfd36e9750585d35b17aa @jvatic jvatic committed
Showing with 10 additions and 2 deletions.
  1. +10 −2 lib/omniauth/strategies/tent.rb
View
12 lib/omniauth/strategies/tent.rb
@@ -62,11 +62,14 @@ def perform_discovery!
end
def find_or_create_app!
+ puts 'find_or_create_app!'
app = Hashie::Mash.new(options[:get_app].call(get_state(:entity)) || {})
+ puts "find_or_create_app! - app[:id] => #{app[:id].inspect}"
app[:id] ? set_app(app) : create_app
end
def set_app(app)
+ puts "set_app: #{app.inspect}"
set_state(:app, app)
end
@@ -76,18 +79,23 @@ def get_app
def create_app
client = ::TentClient.new(@server_url)
- res = client.app.create(
+ app_attrs = {
:name => options.app.name,
:description => options.app.description,
:scopes => options.app.scopes,
:icon => options.app.icon,
:url => options.app.url,
:redirect_uris => options.app.redirect_uris || [callback_url]
- )
+ }
+ puts "create_app - app_attrs => #{app_attrs.inspect}"
+
+ res = client.app.create(app_attrs)
+ puts "create_app - app => #{res.inspect}"
if (app = res.body) && !app.kind_of?(::String)
set_app(app)
else
+ puts "create_app - fail!"
fail!(:app_create_failure, AppCreateFailure.new(res.body))
end
end

0 comments on commit 233cc3c

Please sign in to comment.
Something went wrong with that request. Please try again.