Display user storage usage on the dashboard

This commit is contained in:
2024-09-12 13:52:57 +07:00
parent b0a9161fb6
commit 16ae5f3bd7
10 changed files with 173 additions and 75 deletions

View File

@ -2,14 +2,14 @@ package userSessionTerminateHandler
import (
"github.com/fossyy/filekeeper/session"
"github.com/fossyy/filekeeper/types"
"github.com/fossyy/filekeeper/view/client/user"
"net/http"
)
func DELETE(w http.ResponseWriter, r *http.Request) {
id := r.PathValue("id")
_, mySession, _ := session.GetSession(r)
mySession := r.Context().Value("user").(types.User)
otherSession := session.Get(id)
if _, err := session.GetSessionInfo(mySession.Email, otherSession.ID); err != nil {
w.WriteHeader(http.StatusUnauthorized)