Files
maxwarden/handlers/app/delete.go
2025-03-06 23:54:11 -05:00

17 lines
321 B
Go

package app
import (
"maxwarden/entries"
"maxwarden/middleware"
"net/http"
)
func DeleteHandler(w http.ResponseWriter, r *http.Request) {
identity := middleware.GetIdentity(r)
id := r.PathValue("id")
entries.DeleteSecret(identity.UserID, identity.MasterKey, id)
http.Redirect(w, r, "/app", http.StatusFound)
}