Permalink
Browse files

Add creating users record.

  • Loading branch information...
1 parent 52fbdda commit 2700d95a6e4722a28cba9a03c6ca65414d37959b @ppworks committed Jun 7, 2012
Showing with 4 additions and 4 deletions.
  1. +4 −4 app.rb
View
8 app.rb
@@ -25,9 +25,9 @@
get '/auth/:name/callback' do
@auth = request.env['omniauth.auth']
- if User.find_by_uid @auth[:uid]
- else
- User.create({
+ @user = User.find_by_uid @auth[:uid]
+ if @user.nil?
+ @user = User.create({
:uid => @auth[:uid],
:name => @auth[:info][:name],
:image => @auth[:info][:image],
@@ -53,5 +53,5 @@
%div.title Hello world
%a{:href => '/auth/twitter'} login
@@ callback
-%pre= @auth.to_yaml
+%img{:src => @user.image}
@@ failure

0 comments on commit 2700d95

Please sign in to comment.