diff --git a/assets/output.css b/assets/output.css index 07bb6af..a9dbd03 100644 --- a/assets/output.css +++ b/assets/output.css @@ -767,6 +767,14 @@ select { inset: 0px; } +.-inset-1 { + inset: -0.25rem; +} + +.-inset-1\.5 { + inset: -0.375rem; +} + .inset-x-0 { left: 0px; right: 0px; @@ -864,6 +872,10 @@ select { margin-top: 1.5rem; } +.ml-4 { + margin-left: 1rem; +} + .block { display: block; } @@ -1286,6 +1298,11 @@ select { color: rgb(255 255 255 / var(--tw-text-opacity)); } +.text-gray-400 { + --tw-text-opacity: 1; + color: rgb(156 163 175 / var(--tw-text-opacity)); +} + .opacity-30 { opacity: 0.3; } @@ -1365,6 +1382,11 @@ select { --tw-ring-color: rgb(17 24 39 / 0.2); } +.focus\:outline-none:focus { + outline: 2px solid transparent; + outline-offset: 2px; +} + .focus\:ring-2:focus { --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); @@ -1380,6 +1402,19 @@ select { --tw-ring-color: rgb(79 70 229 / var(--tw-ring-opacity)); } +.focus\:ring-white:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(255 255 255 / var(--tw-ring-opacity)); +} + +.focus\:ring-offset-2:focus { + --tw-ring-offset-width: 2px; +} + +.focus\:ring-offset-gray-800:focus { + --tw-ring-offset-color: #1f2937; +} + .focus-visible\:outline:focus-visible { outline-style: solid; } @@ -1488,6 +1523,10 @@ select { } @media (min-width: 768px) { + .md\:ml-6 { + margin-left: 1.5rem; + } + .md\:block { display: block; } diff --git a/src/app/ui/login/mod.rs b/src/app/ui/login/mod.rs index 98224c4..2fb0ee9 100644 --- a/src/app/ui/login/mod.rs +++ b/src/app/ui/login/mod.rs @@ -11,4 +11,5 @@ pub fn router() -> Router { Router::new() .route("/login", get(route::login_form)) .route("/login", post(route::login)) + .route("/logout", get(route::logout)) } diff --git a/src/app/ui/login/route.rs b/src/app/ui/login/route.rs index fdf2811..8197a25 100644 --- a/src/app/ui/login/route.rs +++ b/src/app/ui/login/route.rs @@ -75,3 +75,11 @@ pub async fn login( .unwrap(), } } + +#[tracing::instrument(name = "Logout", skip(session))] +pub async fn logout(session: Session) -> impl IntoResponse { + session.clear().await; + session.save().await.unwrap(); + + Redirect::temporary("/").into_response() +} diff --git a/templates/admin_dashboard.html b/templates/admin_dashboard.html index b2a2fa4..ffa6bfb 100644 --- a/templates/admin_dashboard.html +++ b/templates/admin_dashboard.html @@ -29,22 +29,27 @@ + - - + -
-
-

Newsletter

-
-
-
-
- -

Hi {{ user }}! Welcome to our newsletter!

-
-
+
+
+

Newsletter

+
+
+
+
+ +

Hi {{ user }}! Welcome to our newsletter!

+
+
{% endblock %} \ No newline at end of file diff --git a/templates/login.html b/templates/login.html index 4853fb9..8a1f7bf 100644 --- a/templates/login.html +++ b/templates/login.html @@ -10,8 +10,7 @@

-
+