forked from jason/cpolis
Initial version of native session management
This commit is contained in:
@@ -10,11 +10,10 @@ import (
|
||||
b "streifling.com/jason/cpolis/cmd/backend"
|
||||
)
|
||||
|
||||
func UploadPDF(c *b.Config, s *b.CookieStore) http.HandlerFunc {
|
||||
func UploadPDF(c *b.Config, s map[string]*Session) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
if _, err := GetSession(w, r, c, s); err != nil {
|
||||
log.Println(err)
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
if _, err := ManageSession(w, r, c, s); err != nil {
|
||||
http.Error(w, "Die Session ist abgelaufen. Bitte erneut anmelden.", http.StatusUnauthorized)
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user