aboutsummaryrefslogtreecommitdiff
path: root/directory.go
diff options
context:
space:
mode:
authorQuentin <quentin@dufour.io>2023-09-26 06:44:36 +0000
committerQuentin <quentin@dufour.io>2023-09-26 06:44:36 +0000
commit49d8e81fbea0d4703a33e87a807927169a8060ac (patch)
treed0b655454d5e13ed2238060fee27fc0d951d64c8 /directory.go
parent1e75c21b65021da0c3c5a8be9be12114a2327464 (diff)
parent706ff58a6f6608719feda15075d50f978df39c5b (diff)
downloadguichet-49d8e81fbea0d4703a33e87a807927169a8060ac.tar.gz
guichet-49d8e81fbea0d4703a33e87a807927169a8060ac.zip
Merge pull request 'An API for Guichet' (#23) from api into main
Reviewed-on: https://git.deuxfleurs.fr/Deuxfleurs/guichet/pulls/23
Diffstat (limited to 'directory.go')
-rw-r--r--directory.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/directory.go b/directory.go
index 0b5acd5..c7520f9 100644
--- a/directory.go
+++ b/directory.go
@@ -15,8 +15,8 @@ const FIELD_NAME_DIRECTORY_VISIBILITY = "directoryVisibility"
func handleDirectory(w http.ResponseWriter, r *http.Request) {
templateDirectory := getTemplate("directory.html")
- login := checkLogin(w, r)
- if login == nil {
+ user := RequireUserHtml(w, r)
+ if user == nil {
return
}
@@ -49,8 +49,8 @@ func handleDirectorySearch(w http.ResponseWriter, r *http.Request) {
}
//Log to allow the research
- login := checkLogin(w, r)
- if login == nil {
+ user := RequireUserHtml(w, r)
+ if user == nil {
http.Error(w, "Login required", http.StatusUnauthorized)
return
}
@@ -69,7 +69,7 @@ func handleDirectorySearch(w http.ResponseWriter, r *http.Request) {
},
nil)
- sr, err := login.conn.Search(searchRequest)
+ sr, err := user.Login.conn.Search(searchRequest)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
return