Class: Booth::Userland::Webauths::New

Inherits:
Object
  • Object
show all
Includes:
Concerns::Action
Defined in:
lib/booth/userland/webauths/new.rb

Instance Method Summary collapse

Instance Method Details

#callObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/booth/userland/webauths/new.rb', line 9

def call
  request.must_be_get!
  request.must_be_html!
  request.must_be_logged_in!

  # This check must come before the Sudo requirement.
  if authenticator&.confirmed?
    return Tron.success :completed, step: :completed,
                                    nickname: authenticator&.nickname,
                                    authenticators?: authenticators?,
                                    should_add_more_authenticators?: should_add_more_authenticators?
  end

  ::Booth::Userland::Webauths::Guards::Sudo.call(request:, credential:) { return it }

  do_new
end