Module: Panda::Core::OAuthProviders

Defined in:
lib/panda/core/oauth_providers.rb

Constant Summary collapse

PROVIDER_INFO =

Provider metadata for display purposes

{
  microsoft_graph: {
    name: "Microsoft",
    icon: "fa-brands fa-microsoft",
    color: "#00a4ef"
  },
  google_oauth2: {
    name: "Google",
    icon: "fa-brands fa-google",
    color: "#4285f4"
  },
  github: {
    name: "GitHub",
    icon: "fa-brands fa-github",
    color: "#333"
  }
}.freeze

Class Method Summary collapse

Class Method Details

.info(provider) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/panda/core/oauth_providers.rb', line 50

def self.info(provider)
  PROVIDER_INFO[provider.to_sym] || {
    name: provider.to_s.titleize,
    icon: "fa-solid fa-circle-user",
    color: "#6b7280"
  }
end

.setupObject



23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/panda/core/oauth_providers.rb', line 23

def self.setup
  providers = []

  begin
    require "omniauth/strategies/github"
    providers << :github
  rescue LoadError
    # GitHub OAuth functionality not available
  end

  begin
    require "omniauth/strategies/google_oauth2"
    providers << :google_oauth2
  rescue LoadError
    # Google OAuth functionality not available
  end

  begin
    require "omniauth/strategies/microsoft_graph"
    providers << :microsoft_graph
  rescue LoadError
    # Microsoft OAuth functionality not available
  end

  providers
end