class Forem::ApplicationController < ApplicationController

  private

  def authenticate_forem_user
    if !forem_user
      session[:return_to] = request.fullpath
      flash.alert = t("forem.errors.not_signed_in")
      redirect_to main_app.sign_in_path
    end
  end

  def forem_admin?
    forem_user && forem_user.forem_admin?
  end
  helper_method :forem_admin?

end

class Forem::ApplicationController < ApplicationController

  private

  def authenticate_forem_user
    if !forem_user
      session["user_return_to"] = request.fullpath
      flash.alert = t("forem.errors.not_signed_in")
      redirect_to main_app.sign_in_path
    end
  end

  def forem_admin?
    forem_user && forem_user.forem_admin?
  end
  helper_method :forem_admin?

end

Use user_return_to rather than just 'return_to'
Use user_return_to rather than just 'return_to'

Devise now requires the scope to be prefixed to the return_to session variable when using it as a location store

Fixes #58
