Move user caching functionality to dedicated package

This commit is contained in:
2024-04-29 11:09:19 +07:00
parent 994b1faacf
commit 36e03c6dca
7 changed files with 109 additions and 98 deletions

View File

@ -2,10 +2,10 @@ package signinHandler
import (
"errors"
"github.com/fossyy/filekeeper/cache"
"net/http"
"strings"
"github.com/fossyy/filekeeper/db/model/user"
"github.com/fossyy/filekeeper/logger"
"github.com/fossyy/filekeeper/session"
"github.com/fossyy/filekeeper/types"
@ -41,7 +41,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
}
email := r.Form.Get("email")
password := r.Form.Get("password")
userData, err := user.Get(email)
userData, err := cache.GetUser(email)
if err != nil {
component := signinView.Main("Sign in Page", types.Message{
Code: 0,