forked from External/greenlight
able to handle launcher login
This commit is contained in:
@ -6,6 +6,7 @@ class ApplicationController < ActionController::Base
|
||||
include SessionsHelper
|
||||
|
||||
protect_from_forgery with: :exception
|
||||
skip_before_filter :verify_authenticity_token
|
||||
|
||||
MEETING_NAME_LIMIT = 90
|
||||
USER_NAME_LIMIT = 30
|
||||
|
@ -5,6 +5,14 @@ class MainController < ApplicationController
|
||||
|
||||
# GET /
|
||||
def index
|
||||
if current_user
|
||||
# Redirect authenticated users to their room.
|
||||
redirect_to room_path(current_user.room)
|
||||
else
|
||||
# Redirect unauthenticated users to root.
|
||||
#TODO use env? for launcher login endpoint
|
||||
redirect_to "#{Rails.configuration.relative_url_root}/auth/bn_launcher"
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
@ -65,6 +65,22 @@ class User < ApplicationRecord
|
||||
def google_image(auth)
|
||||
auth['info']['image']
|
||||
end
|
||||
|
||||
def bn_launcher_name(auth)
|
||||
auth['user_info']['username']
|
||||
end
|
||||
|
||||
def bn_launcher_username(auth)
|
||||
auth['user_info']['username']
|
||||
end
|
||||
|
||||
def bn_launcher_email(auth)
|
||||
auth['user_info']['email']
|
||||
end
|
||||
|
||||
def bn_launcher_image(auth)
|
||||
""
|
||||
end
|
||||
end
|
||||
|
||||
# Retrives a list of all a users rooms that are not the main room, sorted by last session date.
|
||||
|
Reference in New Issue
Block a user