diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2025-01-03 01:50:07 -0800 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2025-01-03 01:53:19 -0800 |
commit | 5cc70cc65667d40048f274efe0528ed13b189666 (patch) | |
tree | f2d9fbd57505fdf1b238d0b29c1ff4f42529f695 | |
parent | f163a242792cd325c9414587d52f3d8584f28df1 (diff) | |
download | phoneof-5cc70cc65667d40048f274efe0528ed13b189666.tar.gz phoneof-5cc70cc65667d40048f274efe0528ed13b189666.zip |
make it a password
-rw-r--r-- | api/api.go | 2 | ||||
-rw-r--r-- | templates/home.html | 4 | ||||
-rw-r--r-- | templates/messages.html | 3 |
3 files changed, 6 insertions, 3 deletions
@@ -89,7 +89,7 @@ func MakeMux(argv *args.Arguments, dbConn *sql.DB) *http.ServeMux { LogRequestContinuation(requestContext, r, w)(template.TemplateContinuation(templateFile, true), FailurePassingContinuation)(LogExecutionTimeContinuation, LogExecutionTimeContinuation)(IdContinuation, IdContinuation) }) - mux.HandleFunc("GET /chat", func(w http.ResponseWriter, r *http.Request) { + mux.HandleFunc("POST /chat/me", func(w http.ResponseWriter, r *http.Request) { requestContext := makeRequestContext() LogRequestContinuation(requestContext, r, w)(chat.ValidateFren, FailurePassingContinuation)(template.TemplateContinuation("chat.html", true), FailurePassingContinuation)(LogExecutionTimeContinuation, LogExecutionTimeContinuation)(IdContinuation, IdContinuation) }) diff --git a/templates/home.html b/templates/home.html index 7e8ecb7..8594993 100644 --- a/templates/home.html +++ b/templates/home.html @@ -1,8 +1,8 @@ {{ define "content" }} <p>please use this if you know who i am and know how to use this but need to get ahold of me while im away from computers.</p> -<form action="/chat" method="GET" autocomplete="off"> +<form action="/chat/me" method="POST" autocomplete="off"> <label for="fren_id">fren id.</label> - <input type="text" id="fren_id" name="fren_id"> + <input type="password" id="fren_id" name="fren_id"> <input type="submit" value="login."> </form> {{ end }} diff --git a/templates/messages.html b/templates/messages.html index e09ac46..85764e3 100644 --- a/templates/messages.html +++ b/templates/messages.html @@ -1,5 +1,8 @@ {{ define "content" }} <div id="chat-container" class="chat-container"> + {{ if (eq (len .Messages) 0) }} + <p>nothing here so far...</p> + {{ end }} {{ range $message := .Messages }} <div class="message {{if $message.FrenSent}}fren{{end}}"> <div class="message-text {{if $message.FrenSent}}fren{{end}}"> |