aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/sessions_controller.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb
index 16d11b5..c755c69 100644
--- a/app/controllers/sessions_controller.rb
+++ b/app/controllers/sessions_controller.rb
@@ -1,2 +1,13 @@
class SessionsController < ApplicationController
+ def create
+ @user = User.find_or_create_from_auth_hash(auth_hash)
+ self.current_user = @user
+ redirect_to '/'
+ end
+
+ protected
+
+ def auth_hash
+ request.env['omniauth.auth']
+ end
end