fix(user): clear need_change_password and invalidate cache on password change

This commit is contained in:
ryan
2026-08-29 11:52:41 +08:00
parent d3d7c783a9
commit 64fe1658d4
5 changed files with 77 additions and 8 deletions
+10
View File
@@ -5,8 +5,10 @@ package cmd
import (
"Wavelet/core"
"context"
"testing"
"github.com/alicebob/miniredis/v2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
@@ -106,12 +108,20 @@ func TestNewWaveletAppProfiles(t *testing.T) {
}
func TestNewWaveletAppWithRedisEnabled(t *testing.T) {
mr, err := miniredis.Run()
require.NoError(t, err)
defer mr.Close()
app := newWaveletApp(core.ProfileAll, core.WithConfigValues(map[string]any{
"redis": map[string]any{
"enabled": true,
"addrs": []string{mr.Addr()},
},
}))
require.NotNil(t, app)
defer func() {
_ = app.Stop(context.Background())
}()
require.NoError(t, app.Reconcile())
f, ok := app.Fiber("cache")