Display user storage usage on the dashboard
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user