Created
August 16, 2018 10:52
-
-
Save NaiyaShah-BTC/a65b24222f0cd7055c415c4ab81dd566 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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