From 20f79d3aa5360980e518874fae31b34e21dfb0d3 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 10 Sep 2013 00:56:55 +0000 Subject: [PATCH] more work --- app/controllers/sessions_controller.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 053e2bdb0..c516b01d3 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -73,15 +73,17 @@ class SessionsController < ApplicationController end auth_hash = request.env['omniauth.auth'] - authorization = UserAuthorization.find_by_provider_and_uid(auth_hash["provider"], auth_hash["uid"]) + #authorization = UserAuthorization.find_by_provider_and_uid(auth_hash["provider"], auth_hash["uid"]) - if authorization.nil? + # Always make and save a new authorization. This is because they expire, and honestly there's no cost + # to just making and saving it. + #if authorization.nil? authorization = current_user.user_authorizations.build :provider => auth_hash[:provider], :uid => auth_hash[:uid], :token => auth_hash[:credentials][:token], :token_expiration => Time.at(auth_hash[:credentials][:expires_at]) authorization.save - end + #end render 'oauth_complete', :layout => "landing" end