forked from External/greenlight
Merge branch 'master' of github.com:blindsidenetworks/greenlight
This commit is contained in:
@ -16,4 +16,16 @@ class LandingController < ApplicationController
|
||||
end
|
||||
end
|
||||
|
||||
def room
|
||||
@room_name = params[:name]
|
||||
@user = User.find_by(username: @room_name)
|
||||
if @user.nil?
|
||||
redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
def admin?
|
||||
@user == current_user
|
||||
end
|
||||
helper_method :admin?
|
||||
end
|
||||
|
@ -2,9 +2,9 @@ class SessionsController < ApplicationController
|
||||
def create
|
||||
@user = User.from_omniauth(request.env['omniauth.auth'])
|
||||
session[:user_id] = @user.id
|
||||
redirect_to controller: 'landing', action: 'room', name: @user.username
|
||||
rescue => e
|
||||
logger.error "Error authenticating via omniauth: #{e}"
|
||||
ensure
|
||||
redirect_to root_path
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user