init - add project files
This commit is contained in:
17
handlers/app/delete.go
Normal file
17
handlers/app/delete.go
Normal file
@@ -0,0 +1,17 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user