Class: Masks::Credentials::Password

Inherits:
Masks::Credential show all
Defined in:
app/models/masks/credentials/password.rb

Overview

Checks :password for a match.

Instance Method Summary collapse

Methods inherited from Masks::Credential

#backup, #backup!, #check, checks, #cleanup, #cleanup!, #mask!, #name, #patch_params, #slug

Instance Method Details

#lookupObject



9
10
11
12
13
# File 'app/models/masks/credentials/password.rb', line 9

def lookup
  actor.password = password if actor&.new_record? && password

  nil
end

#maskupObject



15
16
17
18
19
# File 'app/models/masks/credentials/password.rb', line 15

def maskup
  return unless password

  actor&.authenticate(password) && actor&.valid? ? approve! : deny!
end