Class: Masks::Credentials::Email

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

Overview

Checks for an :actor given a matching email.

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
14
15
16
17
18
19
20
21
# File 'app/models/masks/credentials/email.rb', line 9

def lookup
  return if actor || !email

  actor = config.find_actor(session, email:)
  actor ||=
    config.build_actor(
      session,
      email:,
      nickname: generate_nickname(email)
    )
  actor. = true
  actor
end

#maskupObject



23
24
25
# File 'app/models/masks/credentials/email.rb', line 23

def maskup
  approve! if actor && email && valid?
end