summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBobby <[email protected]>2026-02-11 15:09:11 +0530
committerBobby <[email protected]>2026-02-11 15:09:11 +0530
commit136e437b1ae1697c688c9a548cd4ae0c5a948419 (patch)
treeade966345b90873bd84d9aefdc4c56f8939c9153
parent3360be86fb6a595659c17f272d0c6072e512c154 (diff)
downloadcafe-136e437b1ae1697c688c9a548cd4ae0c5a948419.tar.xz
cafe-136e437b1ae1697c688c9a548cd4ae0c5a948419.zip
Refactor logout functionality to render a dedicated logout template and update main page layout for improved user experience
-rw-r--r--controllers/auth.go2
-rw-r--r--templates/auth/logout.django5
-rw-r--r--templates/layouts/base.django4
-rw-r--r--templates/pages/main.django69
4 files changed, 30 insertions, 50 deletions
diff --git a/controllers/auth.go b/controllers/auth.go
index 964a22a..0c9df74 100644
--- a/controllers/auth.go
+++ b/controllers/auth.go
@@ -132,5 +132,5 @@ func Logout(ctx *fiber.Ctx) error {
log.Printf("Failed to destroy session: %v", err)
}
- return shortcuts.Redirect(ctx, "mainHall")
+ return shortcuts.Render(ctx, "auth/logout", nil)
}
diff --git a/templates/auth/logout.django b/templates/auth/logout.django
new file mode 100644
index 0000000..4f26d62
--- /dev/null
+++ b/templates/auth/logout.django
@@ -0,0 +1,5 @@
+{% extends "layouts/base.django" %}
+
+{% block content %}
+You have been logged out. However, if you are still logged in to <a href="https://my.thatcomputerscientist.com"> Shifoo's Dungeon</a>, you may be automatically logged back in when you visit home page again.
+{% endblock content %} \ No newline at end of file
diff --git a/templates/layouts/base.django b/templates/layouts/base.django
index 5390e4b..e8fe890 100644
--- a/templates/layouts/base.django
+++ b/templates/layouts/base.django
@@ -13,8 +13,8 @@
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
{% block head %}{% endblock %}
</head>
- <body class="bg-[#0a0a0f] text-[#e4e4e7] font-['Inter']">
- <div class="flex h-screen overflow-hidden">
+ <body class="">
+ <div class="">
{% block content %}{% endblock %}
</div>
diff --git a/templates/pages/main.django b/templates/pages/main.django
index a746024..6f3994e 100644
--- a/templates/pages/main.django
+++ b/templates/pages/main.django
@@ -2,54 +2,29 @@
{% block content %}
<div class="flex h-screen">
- <div class="bg-[#16213e] w-16 flex flex-col items-center py-4">
- <div class="text-2xl mb-4">☕</div>
- </div>
-
- <div class="flex-1 flex flex-col">
- <div class="bg-[#16213e] border-b border-[#0f3460] px-6 py-4 flex justify-between items-center">
- <h1 class="text-xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-pink-600">
- Main Hall
- </h1>
- <div class="flex items-center gap-4">
- {% if User %}
- <span class="text-gray-300">👋 {{ User.Username }}</span>
- <a href="{% url "auth.logout" %}"
- class="text-sm bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded transition-colors">
- Logout
- </a>
- {% endif %}
- </div>
- </div>
-
- <div class="flex-1 p-6">
- <div class="max-w-4xl mx-auto">
- <div class="bg-[#16213e] rounded-lg shadow-xl p-8 border border-[#0f3460]">
- <h2 class="text-2xl font-bold mb-4 text-white">Welcome to Shifoo's Cafe! ☕</h2>
- <p class="text-gray-400 mb-4">
- You're now authenticated. This is where the main application will be built.
- </p>
-
- {% if User %}
- <div class="mt-6 p-4 bg-[#0f3460]/50 rounded border border-[#0f3460]">
- <h3 class="text-lg font-semibold text-white mb-2">Your User Info:</h3>
- <ul class="text-gray-300 space-y-1">
- <li><strong>Username:</strong> {{ User.Username }}</li>
- <li><strong>Email:</strong> {{ User.Email }}</li>
- <li><strong>Display Name:</strong> {{ User.DisplayName }}</li>
- <li><strong>Admin:</strong> {% if User.IsAdmin %}Yes ⭐{% else %}No{% endif %}</li>
- </ul>
- </div>
- {% endif %}
+ {% if User %}
+ <span class="text-gray-300">👋 {{ User.Username }}</span>
+ <a href="{% url "auth.logout" %}"
+ class="text-sm bg-red-600 hover:bg-red-700 text-white px-4 py-2 rounded transition-colors">
+ Logout
+ </a>
+ {% endif %}
+
+ <h2 class="text-2xl font-bold mb-4 text-white">Welcome to Shifoo's Cafe! ☕</h2>
+ <p class="text-gray-400 mb-4">
+ You're now authenticated. This is where the main application will be built.
+ </p>
- <div class="mt-8 p-4 bg-purple-900/20 border border-purple-700/50 rounded">
- <p class="text-purple-300 text-sm">
- 🚧 The Discord-like interface with Rooms, Lounges, Whispers, and more will be built here!
- </p>
- </div>
- </div>
- </div>
- </div>
+ {% if User %}
+ <div class="mt-6 p-4 bg-[#0f3460]/50 rounded border border-[#0f3460]">
+ <h3 class="text-lg font-semibold text-white mb-2">Your User Info:</h3>
+ <ul class="text-gray-300 space-y-1">
+ <li><strong>Username:</strong> {{ User.Username }}</li>
+ <li><strong>Email:</strong> {{ User.Email }}</li>
+ <li><strong>Display Name:</strong> {{ User.DisplayName }}</li>
+ <li><strong>Admin:</strong> {% if User.IsAdmin %}Yes ⭐{% else %}No{% endif %}</li>
+ </ul>
</div>
+ {% endif %}
</div>
{% endblock %} \ No newline at end of file