MCPcopy
hub / github.com/writefreely/writefreely / NewOAuthButtons

Function NewOAuthButtons

oauth.go:43–54  ·  view source on GitHub ↗

NewOAuthButtons creates a new OAuthButtons struct based on our app configuration.

(cfg *config.Config)

Source from the content-addressed store, hash-verified

41
42// NewOAuthButtons creates a new OAuthButtons struct based on our app configuration.
43func NewOAuthButtons(cfg *config.Config) *OAuthButtons {
44 return &OAuthButtons{
45 SlackEnabled: cfg.SlackOauth.ClientID != "",
46 WriteAsEnabled: cfg.WriteAsOauth.ClientID != "",
47 GitLabEnabled: cfg.GitlabOauth.ClientID != "",
48 GitLabDisplayName: config.OrDefaultString(cfg.GitlabOauth.DisplayName, gitlabDisplayName),
49 GiteaEnabled: cfg.GiteaOauth.ClientID != "",
50 GiteaDisplayName: config.OrDefaultString(cfg.GiteaOauth.DisplayName, giteaDisplayName),
51 GenericEnabled: cfg.GenericOauth.ClientID != "",
52 GenericDisplayName: config.OrDefaultString(cfg.GenericOauth.DisplayName, genericOauthDisplayName),
53 }
54}
55
56// TokenResponse contains data returned when a token is created either
57// through a code exchange or using a refresh token.

Callers 3

viewLoginFunction · 0.85
handleViewInviteFunction · 0.85
handleViewLandingFunction · 0.85

Calls 1

OrDefaultStringFunction · 0.92

Tested by

no test coverage detected