Module: Authentication

Defined in:
app/models/authentication.rb

Class Method Summary collapse

Class Method Details

.authenticate(username, password) ⇒ Object



15
16
17
# File 'app/models/authentication.rb', line 15

def authenticate(username, password)
  self.username == username && self.password == password
end

.passwordObject



11
12
13
# File 'app/models/authentication.rb', line 11

def password
  ENV['AUTH_PASSWORD']
end

.required?Boolean

Returns:

  • (Boolean)


3
4
5
# File 'app/models/authentication.rb', line 3

def required?
  Rails.env.production?
end

.usernameObject



7
8
9
# File 'app/models/authentication.rb', line 7

def username
  ENV['AUTH_USERNAME']
end