Sha256: ab08f1c8979a1ba483fc39c655159421b2d9c5ccc104e79c7c105be312232f45

Contents?: true

Size: 830 Bytes

Versions: 5

Compression:

Stored size: 830 Bytes

Contents

class SessionsController < Devise::SessionsController
  include Sessions::ControllerBase

  # If user_return_to points to an oauth path we disable Turbo on the sign in form.
  # This makes it work when we need to redirect to external sites and/or custom protocols.
  # With Turbo enabled the browser will block those redirects with a CORS error.
  # https://github.com/bullet-train-co/bullet_train/issues/384
  def user_return_to_is_oauth
    session["user_return_to"]&.match(/^\/oauth/)
  end
  helper_method :user_return_to_is_oauth

  def destroy
    if params.include?(:onboard_logout)
      signed_out = (Devise.sign_out_all_scopes ? sign_out : sign_out(resource_name))
      set_flash_message! :notice, :signed_out if signed_out
      yield if block_given?
      redirect_to root_path
    else
      super
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bullet_train-1.2.4 app/controllers/sessions_controller.rb
bullet_train-1.2.3 app/controllers/sessions_controller.rb
bullet_train-1.2.2 app/controllers/sessions_controller.rb
bullet_train-1.2.1 app/controllers/sessions_controller.rb
bullet_train-1.2.0 app/controllers/sessions_controller.rb