Improve 2FA security and user experience
This commit is contained in:
@ -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,
|
||||
|
@ -1,7 +1,6 @@
|
||||
package forgotPasswordVerifyHandler
|
||||
|
||||
import (
|
||||
"github.com/fossyy/filekeeper/cache"
|
||||
"github.com/fossyy/filekeeper/db"
|
||||
forgotPasswordHandler "github.com/fossyy/filekeeper/handler/forgotPassword"
|
||||
"github.com/fossyy/filekeeper/logger"
|
||||
@ -98,8 +97,6 @@ func POST(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
session.RemoveAllSessions(data.User.Email)
|
||||
|
||||
cache.DeleteUser(data.User.Email)
|
||||
|
||||
component := forgotPasswordView.ChangeSuccess("Filekeeper - Forgot Password Page")
|
||||
err = component.Render(r.Context(), w)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user