diff --git a/template/pages/login.jet.html b/template/pages/login.jet.html index fb54b2b..2eaccdd 100644 --- a/template/pages/login.jet.html +++ b/template/pages/login.jet.html @@ -1,12 +1,28 @@
-

Login with your account

-

In order to enable the landing page and other features, you will have to login. -

-

You can only login using your account's cookie, check out this page to - see how to get it.

-
- - -
+

Login with your account

+

+ In order to enable the landing page and other features, you will have to + login. +

+

+ You can only login using your account's cookie, check out + this page + to see how to get it. +

+
+ + +
+
+

Logout

+

+ You can safely logout here. This button will just delete the token directly + from this session. +

+
+ +
diff --git a/views/pages.go b/views/pages.go index f43c410..d664932 100644 --- a/views/pages.go +++ b/views/pages.go @@ -299,6 +299,8 @@ func settings_post(c *fiber.Ctx) error { error = set_image_server(c) case "token": error = set_token(c) + case "logout": + error = set_logout(c) default: error = "No method available" } diff --git a/views/settings.go b/views/settings.go index 9d01a6e..4737395 100644 --- a/views/settings.go +++ b/views/settings.go @@ -96,3 +96,13 @@ func set_image_server(c *fiber.Ctx) string { } return "Empty form" } + +func set_logout(c *fiber.Ctx) string { + name := "token" + sess := get_storage(c) + + sess.Delete(name) + save_storage(sess) + + return "" +}