Skip to content

Instantly share code, notes, and snippets.

@NaiyaShah-BTC
Created August 16, 2018 10:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NaiyaShah-BTC/a65b24222f0cd7055c415c4ab81dd566 to your computer and use it in GitHub Desktop.
Save NaiyaShah-BTC/a65b24222f0cd7055c415c4ab81dd566 to your computer and use it in GitHub Desktop.
def token_catcher
tokens = Boxr::get_tokens(params['code'],
grant_type: 'authorization_code',
assertion: nil,
scope: nil,
username: nil,
client_id: ENV['CLIENT_ID'],
client_secret: ENV['CLIENT_SECRET'])
TokenCred.create!(access: tokens['access_token'],
refresh: tokens['refresh_token'])
render nothing: true
rescue => e
puts ">>>>>>>>>>>>>>>>>>>>> #{e.message}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment