Class: Panda::Core::Admin::MyProfile::ConnectedAccountComponent

Inherits:
Base
  • Object
show all
Defined in:
app/components/panda/core/admin/my_profile/connected_account_component.rb

Constant Summary

Constants inherited from Base

Base::TAILWIND_MERGER

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(provider:, user:) ⇒ ConnectedAccountComponent

Returns a new instance of ConnectedAccountComponent.



8
9
10
11
12
13
14
15
16
# File 'app/components/panda/core/admin/my_profile/connected_account_component.rb', line 8

def initialize(provider:, user:)
  @provider = provider
  @user = user
  @provider_info = Panda::Core::OAuthProviders.info(provider)
  # TODO: Track which provider user logged in with
  # For now, we don't track the provider, so we can't show connection status
  @is_connected = user.respond_to?(:oauth_provider) && user.oauth_provider == provider.to_s
  super()
end

Instance Attribute Details

#provider_infoObject (readonly)

Returns the value of attribute provider_info.



18
19
20
# File 'app/components/panda/core/admin/my_profile/connected_account_component.rb', line 18

def provider_info
  @provider_info
end

Instance Method Details

#connected?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'app/components/panda/core/admin/my_profile/connected_account_component.rb', line 20

def connected?
  @is_connected
end