diff --git a/app/controllers/landing_controller.rb b/app/controllers/landing_controller.rb index a9321817..e500e1a2 100644 --- a/app/controllers/landing_controller.rb +++ b/app/controllers/landing_controller.rb @@ -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 diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 98fba033..0deef207 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -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 diff --git a/app/views/landing/room.html.erb b/app/views/landing/room.html.erb index e50c7492..b19b97b3 100644 --- a/app/views/landing/room.html.erb +++ b/app/views/landing/room.html.erb @@ -8,7 +8,7 @@ Hello <%= current_user.name %> <%= link_to "Logout", user_logout_url() %> <% else %> - <%= link_to "Login", "/auth/twitter" %> + <%= link_to "Login", "/auth/#{@user.provider}" %> <% end %> @@ -21,4 +21,3 @@ - diff --git a/test/fixtures/users.yml b/test/fixtures/users.yml index c105d045..449a17c8 100644 --- a/test/fixtures/users.yml +++ b/test/fixtures/users.yml @@ -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