diff options
| author | James Elliott <james-d-elliott@users.noreply.github.com> | 2023-05-24 05:57:53 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-24 05:57:53 +1000 |
| commit | f724818c44ffc5fa104529e658f4c2985b425847 (patch) | |
| tree | 62d8919d5add711178d55e71bad381155549f928 /internal/authentication/file_user_provider.go | |
| parent | 3131aa77d4ed18adf6f30f62e3482b9d05d88f03 (diff) | |
test(authentication): file provider (#5473)
Add additional tests to the file provider.
Signed-off-by: James Elliott <james-d-elliott@users.noreply.github.com>
Diffstat (limited to 'internal/authentication/file_user_provider.go')
| -rw-r--r-- | internal/authentication/file_user_provider.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/authentication/file_user_provider.go b/internal/authentication/file_user_provider.go index 9da2c4178..270ddd50e 100644 --- a/internal/authentication/file_user_provider.go +++ b/internal/authentication/file_user_provider.go @@ -34,6 +34,7 @@ func NewFileUserProvider(config *schema.FileAuthenticationBackend) (provider *Fi config: config, mutex: &sync.Mutex{}, timeoutReload: time.Now().Add(-1 * time.Second), + database: NewFileUserDatabase(config.Path, config.Search.Email, config.Search.CaseInsensitive), } } @@ -136,7 +137,9 @@ func (p *FileUserProvider) StartupCheck() (err error) { return err } - p.database = NewFileUserDatabase(p.config.Path, p.config.Search.Email, p.config.Search.CaseInsensitive) + if p.database == nil { + p.database = NewFileUserDatabase(p.config.Path, p.config.Search.Email, p.config.Search.CaseInsensitive) + } if err = p.database.Load(); err != nil { return err |
