samhuri.net/server/auth.rb
Sami Samhuri 70e8ff6b18 slap a sinatra API server in front of HarpBlog
terminate meta_weblog_handler.rb with extreme prejudice
2014-10-18 01:38:45 -07:00

11 lines
244 B
Ruby

require 'json'
class Auth
def initialize(filename)
@credentials = JSON.parse(File.read(filename))
end
def authenticated?(username, password)
@credentials['username'] == username && @credentials['password'] == password
end
end