mirror of
https://github.com/samsonjs/samhuri.net.git
synced 2026-03-25 09:05:47 +00:00
11 lines
244 B
Ruby
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
|