From a9fce1bcbfa525fec68c14c404df52773658c773 Mon Sep 17 00:00:00 2001 From: efim Date: Fri, 6 Oct 2023 09:40:28 +0000 Subject: [PATCH] feat: moving dialog script to head this way htmx page switch would keep it. and calling on event DOM loaded means elements should be found --- auth-notes.org | 6 ++-- pages/templates/index.gohtml | 67 ++++++++++++++++++++++-------------- 2 files changed, 44 insertions(+), 29 deletions(-) diff --git a/auth-notes.org b/auth-notes.org index 4cbba06..1891f38 100644 --- a/auth-notes.org +++ b/auth-notes.org @@ -4,9 +4,9 @@ https://pocketbase.io/docs/go-overview/ * plan ** DONE start pocketbase ** DONE add middlewares for cookie session -** TODO add index page, that will have either "current user" or 'login' link -*** TODO let's add some content that only opens up when person is authed -*** TODO also, how do i logout? +** DONE add index page, that will have either "current user" or 'login' link +*** DONE let's add some content that only opens up when person is authed +*** DONE also, how do i logout? separate route that deleted the cookie i guess. since auth is a jwt which would expire on its own and htmx get thingy, and reload i guess? diff --git a/pages/templates/index.gohtml b/pages/templates/index.gohtml index a63c1ff..68e3b74 100644 --- a/pages/templates/index.gohtml +++ b/pages/templates/index.gohtml @@ -36,9 +36,27 @@ pb.authStore.clear(); } + -

Welcome to index page

-

{{ .Username }}

- - - -

Greetings, one and all!

- {{ range .EnabledOauthProviders }} - +
- + +
+

Welcome to index page

+ {{ if not .IsGuest }} +

This is content only for authenticated users! Congratulations!

+ {{ end }} +