app/controllers/sessions_controller.rb
# This url is called by gamebus when clicking on the connect button in the app
# It has two get parameters: userid and token.
# This token is the encryped token and must be decrypted
This url is called by gamebus when clicking on the connect button in the app
It has two get parameters: userid and token.
This token is the encryped token and must be decrypted
This url is called by gamebus when clicking on the connect button in the app It has two get parameters : userid and token . This token is the encryped token and must be decrypted
def connect
    @user = User.find_or_initialize_by(gamebus_id: params[:userid])
    @user.gamebus_key = params[:token]
    @user.save!
    session[:user_id] = @user.id
    render :connected if @user.rvs_key_valid?
  end
def connect @user = User . find_or_initialize_by ( gamebus_id : params [ :userid ] ) @user . gamebus_key = params [ :token ] @user . save! session [ :user_id ] = @user . id render :connected if @user . rvs_key_valid? end
This url is called by gamebus when clicking on the connect button in the app
It has two get parameters: userid and token.
This url is called by gamebus when clicking on the connect button in the app It has two get parameters : userid and token .
# First find the user and update it's encrypted key # Then save the user in the session so it can be found again later # Check the user's RVS key and act accordingly