Fix session retrieval issue after migrating to Redis cache

This commit is contained in:
2024-09-08 16:41:33 +07:00
parent 2c5de2b336
commit 29ab28fd93
5 changed files with 30 additions and 42 deletions

View File

@ -37,8 +37,8 @@ func POST(w http.ResponseWriter, r *http.Request) {
totp := gotp.NewDefaultTOTP(user.Totp)
if totp.Verify(code, time.Now().Unix()) {
storeSession, err := session.Get(key)
err = storeSession.Change(types.User{
storeSession := session.Get(key)
err := storeSession.Change(types.User{
UserID: user.UserID,
Email: user.Email,
Username: user.Username,