Sha256: 9a53fcbe71e2e7a859c11b654375aab834a535e3a63e8458d219805e82f32923

Contents?: true

Size: 561 Bytes

Versions: 2

Compression:

Stored size: 561 Bytes

Contents

module Crowdblog::Devise

  module Sessions
    def destroy
      sign_out current_user
      redirect_to root_url
    end
  end

  module Auth
    def authenticate!
      # sign out the user if trying to sign another user
      sign_out current_user if params['auth_token'] && current_user

      # if no one signed in, use the default user
      unless user_signed_in?
        user = Crowdblog::User.find_by_email('foo@crowdint.com') || Crowdblog::User.create!(email: 'foo@crowdint.com', is_publisher: true)
        sign_in user
      end

    end
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
crowdblog-0.0.3 spec/dummy/config/initializers/crowdblog.rb
crowdblog-0.0.2 spec/dummy/config/initializers/crowdblog.rb