Skip to content

Instantly share code, notes, and snippets.

@gusrub
Created March 4, 2018 03:37
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 gusrub/dee9b15e1e39b9f0b97f1f47f25163dc to your computer and use it in GitHub Desktop.
Save gusrub/dee9b15e1e39b9f0b97f1f47f25163dc to your computer and use it in GitHub Desktop.
class TokenProvider
def self.generate(email)
uri = URI("https://example.com/#{email}")
response = Net::HTTP.get_response(uri)
if response.code == '200'
return JSON.parse(response.body)[:token]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment