Permalink
Browse files

added mystique

  • Loading branch information...
1 parent 439a804 commit 0706571199e93a738345971d5505c521d39a7598 @jdxcode committed May 31, 2012
View
@@ -9,13 +9,13 @@ gem 'devise'
gem 'fog'
gem 'haml'
gem 'kaminari', '~> 0.13'
-gem 'omniauth-google-oauth2'
gem 'pry-rails'
gem 'rmagick'
gem 'simple_form'
gem 'split', require: 'split/dashboard'
gem 'split-analytics', require: 'split/analytics'
gem 'tinder', '~> 1.8'
+gem 'tapjoy_client'
group :assets do
gem 'sass-rails', '~> 3.2.3'
View
@@ -116,9 +116,6 @@ GEM
omniauth (1.1.0)
hashie (~> 1.2)
rack
- omniauth-google-oauth2 (0.1.9)
- omniauth (~> 1.0)
- omniauth-oauth2
omniauth-oauth2 (1.0.2)
oauth2 (~> 0.6.0)
omniauth (~> 1.0)
@@ -193,6 +190,9 @@ GEM
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
+ tapjoy_client (1.0.0)
+ omniauth (~> 1.0)
+ omniauth-oauth2
thin (1.3.1)
daemons (>= 1.0.9)
eventmachine (>= 0.12.6)
@@ -237,7 +237,6 @@ DEPENDENCIES
heroku
jquery-rails
kaminari (~> 0.13)
- omniauth-google-oauth2
pg
pry-rails
quiet_assets
@@ -248,6 +247,7 @@ DEPENDENCIES
split
split-analytics
sqlite3
+ tapjoy_client
thin
tinder (~> 1.8)
uglifier (>= 1.0.3)
@@ -1,12 +1,10 @@
class Employees::OmniauthCallbacksController < Devise::OmniauthCallbacksController
- def google_oauth2
+ def tapjoy
employee = request.env["omniauth.auth"]["info"]
- return render text: "You must be logged into Google as a Tapjoy employee.", status: :unauthorized unless employee.email.ends_with? 'tapjoy.com'
@employee = Employee.find_or_create_by_email(employee["email"].downcase)
- flash[:notice] = I18n.t "devise.omniauth_callbacks.success", kind: "Google"
+ flash[:notice] = I18n.t "devise.omniauth_callbacks.success", kind: "Tapjoy"
sign_in_and_redirect @employee, :event => :authentication
- session["devise.google_data"] = request.env["omniauth.auth"]
finished('sign_up_text')
end
end
@@ -3,4 +3,4 @@
%h1 This is WheelerBoard.
- if sign_up_text == 'with_site_info'
%p The wheeler board is where we track who broke Tapjoy.
- %p Wave to Wheeler, then #{ link_to "log in", employee_omniauth_authorize_path(:google_oauth2) } to continue
+ %p Wave to Wheeler, then #{ link_to "log in", employee_omniauth_authorize_path(:tapjoy) } to continue
@@ -28,7 +28,7 @@
%li.divider
%li= link_to "Logout", destroy_employee_session_path, method: :delete
- else
- = link_to employee_omniauth_authorize_path(:google_oauth2), class: 'btn pull-right' do
+ = link_to employee_omniauth_authorize_path(:tapjoy), class: 'btn pull-right' do
%i{class: 'icon-user'}
Login
.container
View
@@ -1,5 +1,3 @@
aws_bucket: wheeler_dev
aws_key: replace this
aws_secret: replace this
-google_key: replace this
-google_secret: replace this
@@ -41,10 +41,8 @@
ENV['AWS_ACCESS_KEY_ID'] = dev['aws_key']
ENV['AWS_SECRET_ACCESS_KEY'] = dev['aws_secret']
ENV['AWS_BUCKET'] = dev['aws_bucket']
- ENV['GOOGLE_KEY'] = dev['google_key']
- ENV['GOOGLE_SECRET'] = dev['google_secret']
- keys = %w(aws_key aws_secret aws_bucket google_key google_secret)
+ keys = %w(aws_key aws_secret aws_bucket)
keys.each do |key|
value = dev[key]
if value.blank? || value == 'replace this'
@@ -210,7 +210,7 @@
# ==> OmniAuth
# Add a new OmniAuth provider. Check the wiki for more information on setting
# up on your models and hooks.
- config.omniauth :google_oauth2, ENV['GOOGLE_KEY'], ENV['GOOGLE_SECRET'], { :access_type => 'online', :approval_prompt => '' }
+ config.omniauth :tapjoy, ENV['TAPJOY_KEY'] || '33c752bae5b2bf93d5eae8a8b86bf68f81d28ece3fef8f665ed452740713b2cd' , ENV['TAPJOY_SECRET'] || '0b4f45b5e6097257b70c85360e59dccc2b4f63bf9fcd990d41ed76b46740f08f'
# ==> Warden configuration
# If you want to use other strategies, that are not supported by Devise, or

0 comments on commit 0706571

Please sign in to comment.