From 2ff8d84ba2463f0daa2531de3d57cd247150bd9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20=C5=A0ediv=C3=BD?= Date: Fri, 13 Jan 2023 00:11:00 +0100 Subject: [PATCH] fix errors. --- internal/member/multiuser/provider.go | 4 ++-- internal/member/noauth/provider.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/member/multiuser/provider.go b/internal/member/multiuser/provider.go index 841e9c6d..915a19fe 100644 --- a/internal/member/multiuser/provider.go +++ b/internal/member/multiuser/provider.go @@ -76,7 +76,7 @@ func (provider *MemberProviderCtx) Insert(username string, password string, prof } func (provider *MemberProviderCtx) UpdateProfile(id string, profile types.MemberProfile) error { - return errors.New("cannot update user profile in multiuser mode") + return nil } func (provider *MemberProviderCtx) UpdatePassword(id string, password string) error { @@ -88,7 +88,7 @@ func (provider *MemberProviderCtx) Select(id string) (types.MemberProfile, error } func (provider *MemberProviderCtx) SelectAll(limit int, offset int) (map[string]types.MemberProfile, error) { - return map[string]types.MemberProfile{}, errors.New("cannot select users in multiuser mode") + return map[string]types.MemberProfile{}, nil } func (provider *MemberProviderCtx) Delete(id string) error { diff --git a/internal/member/noauth/provider.go b/internal/member/noauth/provider.go index 517b0ef3..4abc0a43 100644 --- a/internal/member/noauth/provider.go +++ b/internal/member/noauth/provider.go @@ -55,11 +55,11 @@ func (provider *MemberProviderCtx) Insert(username string, password string, prof } func (provider *MemberProviderCtx) UpdateProfile(id string, profile types.MemberProfile) error { - return errors.New("cannot update user profile in noauth mode") + return nil } func (provider *MemberProviderCtx) UpdatePassword(id string, password string) error { - return errors.New("password can only be modified in config while in noauth mode") + return errors.New("noauth mode does not have password") } func (provider *MemberProviderCtx) Select(id string) (types.MemberProfile, error) { @@ -67,7 +67,7 @@ func (provider *MemberProviderCtx) Select(id string) (types.MemberProfile, error } func (provider *MemberProviderCtx) SelectAll(limit int, offset int) (map[string]types.MemberProfile, error) { - return map[string]types.MemberProfile{}, errors.New("cannot select users in noauth mode") + return map[string]types.MemberProfile{}, nil } func (provider *MemberProviderCtx) Delete(id string) error {