lib/eucalypt/core/helpers/maintenance.rb in eucalypt-0.5.1 vs lib/eucalypt/core/helpers/maintenance.rb in eucalypt-0.5.2

- old
+ new

@@ -1,7 +1,7 @@ require 'sinatra' -require 'bcrypt' +require 'securerandom' class ApplicationController < Sinatra::Base if settings.methods(false).include?(:maintenance) if settings.maintenance define_singleton_method(:maintenance) do |&block| get '*', &block @@ -12,11 +12,11 @@ options '*', &block link '*', &block unlink '*', &block end else - define_singleton_method(:maintenance) {|&block| get "/#{BCrypt::Password.create(?1)}", &block} + define_singleton_method(:maintenance) {|&block| get "/#{SecureRandom.random_bytes 16}", &block} end else - define_singleton_method(:maintenance) {|&block| get "/#{BCrypt::Password.create(?1)}", &block} + define_singleton_method(:maintenance) {|&block| get "/#{SecureRandom.random_bytes 16}", &block} end end \ No newline at end of file