add private profile page

This commit is contained in:
zapashcanon 2021-11-07 10:32:17 +01:00
parent 6172bc5bb4
commit f06d160fe2
No known key found for this signature in database
GPG key ID: 8981C3C62D1D28F1
2 changed files with 10 additions and 2 deletions

View file

@ -102,7 +102,7 @@ let list () =
| _ -> failwith "error" ) )
users
let profile request =
let public_profile request =
let nick = Dream.param "user" request in
let open Sqlite3_utils in
let user =
@ -116,3 +116,8 @@ let profile request =
email
| Ok _ -> "incoherent db answer"
| Error e -> Format.sprintf "db error: %s" (Rc.to_string e)
let profile request =
match Dream.session "nick" request with
| None -> "not logged in"
| Some nick -> Format.sprintf "Hello %s !" nick