Module: NewsmastMastodon::Concerns::CustomSessionBehavior

Extended by:
ActiveSupport::Concern
Includes:
NonChannelHelper
Defined in:
app/controllers/newsmast_mastodon/concerns/custom_session_behavior.rb

Instance Method Summary collapse

Methods included from NonChannelHelper

#is_non_channel?

Instance Method Details

#createObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/controllers/newsmast_mastodon/concerns/custom_session_behavior.rb', line 7

def create
  self.resource = warden.authenticate!(auth_options)

  unless is_non_channel?
    if (resource) # rubocop:disable Style/SoleNestedConditional
      (resource)
      return
    end
  end

  super do |resource|
    # We only need to call this if this hasn't already been
    # called from one of the two-factor or sign-in token
    # authentication methods

    on_authentication_success(resource, :password) unless @on_authentication_success_called
  end
end