Created
October 3, 2013 16:43
-
-
Save hayduke19us/6812953 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
class SessionsController < ApplicationController | |
def index | |
if current_user | |
token = current_user.access_token | |
secret = current_user.access_secret | |
#for browsing the info | |
filename = '.access_token.yml' | |
File.open filename, 'w' do |f| | |
f.write token | |
f.write secret | |
f.close | |
end | |
end | |
rdio = Rdio::SimpleRdio.new([Figaro.env.omniauth_consumer_key, Figaro.env.omniauth_consumer_secret], | |
[token, secret]) | |
#calls to rdio ---> | |
#playlists rdio.call('getPlaylists')['result']['owned'] | |
end | |
def create | |
user = User.from_omniauth(env["omniauth.auth"]) | |
session[:user_id] = user.id | |
redirect_to root_url | |
end | |
def destroy | |
session[:user_id] = nil | |
redirect_to root_url | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment