Class: ADN::TokenSaver

Inherits:
WEBrick::HTTPServlet::AbstractServlet
  • Object
show all
Defined in:
lib/adn/auth.rb

Instance Method Summary collapse

Instance Method Details

#do_GET(request, response) ⇒ Object



12
13
14
15
# File 'lib/adn/auth.rb', line 12

def do_GET(request, response)
  save_token(request.query['access_token'])
  ADN::Auth.server.stop
end

#save_token(token) ⇒ Object



8
9
10
# File 'lib/adn/auth.rb', line 8

def save_token(token)
  File.open(ADN::Auth::TOKEN_FILE, 'w') {|f| f.write(token) }
end