Merge pull request #16 from zach-chai/login_provider

login with provider in personal room
This commit is contained in:
Zachary Chai 2016-10-20 10:23:56 -04:00 committed by GitHub
commit 50e98e4bcd
4 changed files with 6 additions and 6 deletions

View File

@ -28,7 +28,7 @@ class LandingController < ApplicationController
helper_method :admin?
private
def render_meeting
@resource = params[:resource]
@meeting_token = params[:id] || @meeting_token = helpers.new_meeting_token
@ -42,6 +42,7 @@ class LandingController < ApplicationController
@user = User.find_by(username: @meeting_token)
if @user.nil?
redirect_to root_path
return
end
render :action => 'room'
end

View File

@ -21,7 +21,7 @@ class UsersController < ApplicationController
def set_user
@user = User.find(params[:id])
if @user.username
raise ActionController::RoutingError.new('Not Found')
render 'errors/error'
end
end

View File

@ -8,7 +8,7 @@
<span class="user">Hello <%= current_user.name %></span>
<%= link_to "Logout", user_logout_url() %>
<% else %>
<%= link_to "Login", "/auth/twitter" %>
<%= link_to "Login", "/auth/#{@user.provider}" %>
<% end %>
</div>
</div>
@ -21,4 +21,3 @@
</div>
</div>

View File

@ -1,13 +1,13 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
one:
provider: Twitter
provider: twitter
uid: <%= SecureRandom.hex(10) %>
name: User 1
username: user1
two:
provider: TWitter
provider: google
uid: <%= SecureRandom.hex(10) %>
name: User 2
username: user2