Improve 2FA security and user experience

This commit is contained in:
2024-06-19 22:44:01 +07:00
parent c1059072a6
commit 0e16d59df9
8 changed files with 166 additions and 82 deletions

View File

@ -5,7 +5,7 @@ import (
"context"
"errors"
"fmt"
"github.com/fossyy/filekeeper/cache"
"github.com/fossyy/filekeeper/db"
"github.com/google/uuid"
"net/http"
"strconv"
@ -87,7 +87,7 @@ func POST(w http.ResponseWriter, r *http.Request) {
emailForm := r.Form.Get("email")
user, err := cache.GetUser(emailForm)
user, err := db.DB.GetUser(emailForm)
if errors.Is(err, gorm.ErrRecordNotFound) {
component := forgotPasswordView.Main("Filekeeper - Forgot Password Page", types.Message{
Code: 0,