Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions authentication/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ var providerFactories map[string]ProviderFactory
// providersMtx is used to protect the providerFactories.
var providersMtx sync.RWMutex

func init() {
providerFactories = make(map[string]ProviderFactory)
}

// onboardNewProvider is used by the providers to register themselves.
func onboardNewProvider(providerType string, factory ProviderFactory) {
providersMtx.Lock()
defer providersMtx.Unlock()
if providerFactories == nil {
providerFactories = map[string]ProviderFactory{}
}

providerFactories[providerType] = factory
}
Expand Down