wip: login redirect

This commit is contained in:
Swrup 2022-02-20 18:02:25 +01:00
parent e279acf8db
commit b21671b56a
5 changed files with 41 additions and 32 deletions

View file

@ -1,7 +1,9 @@
let f request =
% begin match Dream.session "nick" request with
% | None ->
<a href="/login">Login</a> to make a new thread.
% let redirect = Dream.to_percent_encoded "/new_thread" in
% Format.printf "%s@." redirect;
<a href="/login?redirect=<%s redirect%>">Login</a> to make a new thread.
% | Some _nick ->
<script type="text/javascript" src="/assets/js/js_newthread.js" defer="defer"></script>
<h1>New thread</h1>