login stuffs

This commit is contained in:
Corban-Lee Jones 2025-01-28 23:59:15 +00:00
parent cdaf525512
commit 118c6f7991
7 changed files with 217 additions and 6 deletions

View File

@ -11,6 +11,7 @@ import { attachGuilds } from "@server/middleware/attachGuilds";
// import routers
import { router as homeRouter } from "@server/routes/home";
import { router as guildRouter } from "@server/routes/guild";
import { router as loginRouter } from "@server/routes/login";
const app = express();
@ -27,6 +28,7 @@ app.use(attachGuilds);
// register routers
app.use("/", homeRouter);
app.use("/guild", guildRouter);
app.use("/login", loginRouter);
const PORT = process.env.PORT || 3000;

View File

@ -759,6 +759,10 @@ video {
margin-inline-start: auto;
}
.mt-0\.5 {
margin-top: 0.125rem;
}
.mt-1 {
margin-top: 0.25rem;
}
@ -775,6 +779,14 @@ video {
margin-top: 1.25rem;
}
.mt-64 {
margin-top: 16rem;
}
.mt-7 {
margin-top: 1.75rem;
}
.mt-auto {
margin-top: auto;
}
@ -901,6 +913,10 @@ video {
width: 7rem;
}
.w-4 {
width: 1rem;
}
.w-60 {
width: 15rem;
}
@ -933,6 +949,10 @@ video {
max-width: 100%;
}
.max-w-md {
max-width: 28rem;
}
.flex-none {
flex: none;
}
@ -1044,6 +1064,10 @@ video {
column-gap: 0.875rem;
}
.gap-y-4 {
row-gap: 1rem;
}
.space-y-0\.5 > :not([hidden]) ~ :not([hidden]) {
--tw-space-y-reverse: 0;
margin-top: calc(0.125rem * calc(1 - var(--tw-space-y-reverse)));
@ -1367,6 +1391,11 @@ video {
line-height: 1.25rem !important;
}
.text-2xl {
font-size: 1.5rem;
line-height: 2rem;
}
.text-4xl {
font-size: 2.25rem;
line-height: 2.5rem;
@ -1400,6 +1429,10 @@ video {
font-weight: 500 !important;
}
.font-bold {
font-weight: 700;
}
.font-medium {
font-weight: 500;
}
@ -1456,6 +1489,11 @@ video {
color: rgb(22 163 74 / var(--tw-text-opacity, 1));
}
.text-red-500 {
--tw-text-opacity: 1;
color: rgb(239 68 68 / var(--tw-text-opacity, 1));
}
.text-red-600 {
--tw-text-opacity: 1;
color: rgb(220 38 38 / var(--tw-text-opacity, 1));
@ -1466,6 +1504,10 @@ video {
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
}
.decoration-2 {
text-decoration-thickness: 2px;
}
.opacity-0 {
opacity: 0;
}
@ -1482,6 +1524,12 @@ video {
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.shadow-sm {
--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);
box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow);
}
.outline {
outline-style: solid;
}
@ -1708,6 +1756,11 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te
inset-inline-start: 0px;
}
.before\:me-6::before {
content: var(--tw-content);
margin-inline-end: 1.5rem;
}
.before\:h-4::before {
content: var(--tw-content);
height: 1rem;
@ -1718,6 +1771,22 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te
width: 100%;
}
.before\:flex-1::before {
content: var(--tw-content);
flex: 1 1 0%;
}
.before\:border-t::before {
content: var(--tw-content);
border-top-width: 1px;
}
.before\:border-gray-200::before {
content: var(--tw-content);
--tw-border-opacity: 1;
border-color: rgb(229 231 235 / var(--tw-border-opacity, 1));
}
.after\:absolute::after {
content: var(--tw-content);
position: absolute;
@ -1733,6 +1802,11 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te
inset-inline-start: 0px;
}
.after\:ms-6::after {
content: var(--tw-content);
margin-inline-start: 1.5rem;
}
.after\:h-4::after {
content: var(--tw-content);
height: 1rem;
@ -1743,6 +1817,22 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te
width: 100%;
}
.after\:flex-1::after {
content: var(--tw-content);
flex: 1 1 0%;
}
.after\:border-t::after {
content: var(--tw-content);
border-top-width: 1px;
}
.after\:border-gray-200::after {
content: var(--tw-content);
--tw-border-opacity: 1;
border-color: rgb(229 231 235 / var(--tw-border-opacity, 1));
}
.hover\:bg-blue-700:hover {
--tw-bg-opacity: 1;
background-color: rgb(29 78 216 / var(--tw-bg-opacity, 1));
@ -1753,6 +1843,11 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te
background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
}
.hover\:bg-gray-50:hover {
--tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1));
}
.hover\:text-blue-600:hover {
--tw-text-opacity: 1;
color: rgb(37 99 235 / var(--tw-text-opacity, 1));
@ -1768,16 +1863,30 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te
color: rgb(31 41 55 / var(--tw-text-opacity, 1));
}
.hover\:underline:hover {
text-decoration-line: underline;
}
.focus\:border-blue-500:focus {
--tw-border-opacity: 1;
border-color: rgb(59 130 246 / var(--tw-border-opacity, 1));
}
.focus\:bg-blue-700:focus {
--tw-bg-opacity: 1;
background-color: rgb(29 78 216 / var(--tw-bg-opacity, 1));
}
.focus\:bg-gray-100:focus {
--tw-bg-opacity: 1;
background-color: rgb(243 244 246 / var(--tw-bg-opacity, 1));
}
.focus\:bg-gray-50:focus {
--tw-bg-opacity: 1;
background-color: rgb(249 250 251 / var(--tw-bg-opacity, 1));
}
.focus\:text-blue-600:focus {
--tw-text-opacity: 1;
color: rgb(37 99 235 / var(--tw-text-opacity, 1));
@ -1788,6 +1897,10 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te
color: rgb(107 114 128 / var(--tw-text-opacity, 1));
}
.focus\:underline:focus {
text-decoration-line: underline;
}
.focus\:opacity-80:focus {
opacity: 0.8;
}
@ -1961,6 +2074,10 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te
padding: 1.5rem;
}
.sm\:p-7 {
padding: 1.75rem;
}
.sm\:px-6 {
padding-left: 1.5rem;
padding-right: 1.5rem;
@ -2134,11 +2251,6 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te
color: rgb(115 115 115 / var(--tw-text-opacity, 1));
}
.dark\:text-neutral-800:where(.dark, .dark *) {
--tw-text-opacity: 1;
color: rgb(38 38 38 / var(--tw-text-opacity, 1));
}
.dark\:text-white:where(.dark, .dark *) {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity, 1));
@ -2148,6 +2260,16 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te
color: rgb(255 255 255 / 0.6);
}
.dark\:placeholder-neutral-500:where(.dark, .dark *)::-moz-placeholder {
--tw-placeholder-opacity: 1;
color: rgb(115 115 115 / var(--tw-placeholder-opacity, 1));
}
.dark\:placeholder-neutral-500:where(.dark, .dark *)::placeholder {
--tw-placeholder-opacity: 1;
color: rgb(115 115 115 / var(--tw-placeholder-opacity, 1));
}
.dark\:placeholder\:text-neutral-400:where(.dark, .dark *)::-moz-placeholder {
--tw-text-opacity: 1;
color: rgb(163 163 163 / var(--tw-text-opacity, 1));
@ -2158,6 +2280,28 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te
color: rgb(163 163 163 / var(--tw-text-opacity, 1));
}
.dark\:before\:border-neutral-600:where(.dark, .dark *)::before {
content: var(--tw-content);
--tw-border-opacity: 1;
border-color: rgb(82 82 82 / var(--tw-border-opacity, 1));
}
.dark\:after\:border-neutral-600:where(.dark, .dark *)::after {
content: var(--tw-content);
--tw-border-opacity: 1;
border-color: rgb(82 82 82 / var(--tw-border-opacity, 1));
}
.dark\:checked\:border-blue-500:checked:where(.dark, .dark *) {
--tw-border-opacity: 1;
border-color: rgb(59 130 246 / var(--tw-border-opacity, 1));
}
.dark\:checked\:bg-blue-500:checked:where(.dark, .dark *) {
--tw-bg-opacity: 1;
background-color: rgb(59 130 246 / var(--tw-bg-opacity, 1));
}
.dark\:hover\:bg-neutral-700:hover:where(.dark, .dark *) {
--tw-bg-opacity: 1;
background-color: rgb(64 64 64 / var(--tw-bg-opacity, 1));
@ -2218,6 +2362,10 @@ hs-accordion-toggle w-full text-start flex items-center gap-x-3.5 py-2 px-2.5 te
--tw-ring-color: rgb(82 82 82 / var(--tw-ring-opacity, 1));
}
.dark\:focus\:ring-offset-gray-800:focus:where(.dark, .dark *) {
--tw-ring-offset-color: #1f2937;
}
.\[\&\:\:-webkit-scrollbar-thumb\]\:rounded-full::-webkit-scrollbar-thumb {
border-radius: 9999px;
}

View File

@ -1,5 +1,9 @@
<% layout("layout") -%>
<h1 class="text-4xl">
<%= guild.name %>
</h1>

View File

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><%= title %></title>
<link rel="stylesheet" href="/static/css/tailwind.css">
</head>
<body class="bg-neutral-100 dark:bg-neutral-900 text-gray-600 dark:text-gray-400 font-[Inter]">
<div class="container mx-auto text-center mt-64">
<div class="max-w-md mx-auto p-4 sm:p-6 space-y-4 sm:space-y-6">
<div class="mt-7 bg-white border border-gray-200 rounded-xl shadow-sm dark:bg-neutral-900 dark:border-neutral-700">
<div class="p-4 sm:p-7">
<div class="text-center">
<h1 class="block text-2xl font-bold text-gray-800 dark:text-white">Sign in</h1>
<p class="mt-2 text-sm text-gray-600 dark:text-neutral-400">
Login is required to use Relay.
</p>
</div>
<div class="mt-5">
<button type="button" class="w-full py-3 px-4 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg border border-gray-200 bg-white text-gray-800 shadow-sm hover:bg-gray-50 focus:outline-none focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-800 dark:focus:bg-neutral-800">
<svg class="w-4 h-auto" xmlns="http://www.w3.org/2000/svg" width="46" height="46" fill="currentColor" class="bi bi-discord" viewBox="0 0 16 16">
<path d="M13.545 2.907a13.2 13.2 0 0 0-3.257-1.011.05.05 0 0 0-.052.025c-.141.25-.297.577-.406.833a12.2 12.2 0 0 0-3.658 0 8 8 0 0 0-.412-.833.05.05 0 0 0-.052-.025c-1.125.194-2.22.534-3.257 1.011a.04.04 0 0 0-.021.018C.356 6.024-.213 9.047.066 12.032q.003.022.021.037a13.3 13.3 0 0 0 3.995 2.02.05.05 0 0 0 .056-.019q.463-.63.818-1.329a.05.05 0 0 0-.01-.059l-.018-.011a9 9 0 0 1-1.248-.595.05.05 0 0 1-.02-.066l.015-.019q.127-.095.248-.195a.05.05 0 0 1 .051-.007c2.619 1.196 5.454 1.196 8.041 0a.05.05 0 0 1 .053.007q.121.1.248.195a.05.05 0 0 1-.004.085 8 8 0 0 1-1.249.594.05.05 0 0 0-.03.03.05.05 0 0 0 .003.041c.24.465.515.909.817 1.329a.05.05 0 0 0 .056.019 13.2 13.2 0 0 0 4.001-2.02.05.05 0 0 0 .021-.037c.334-3.451-.559-6.449-2.366-9.106a.03.03 0 0 0-.02-.019m-8.198 7.307c-.789 0-1.438-.724-1.438-1.612s.637-1.613 1.438-1.613c.807 0 1.45.73 1.438 1.613 0 .888-.637 1.612-1.438 1.612m5.316 0c-.788 0-1.438-.724-1.438-1.612s.637-1.613 1.438-1.613c.807 0 1.451.73 1.438 1.613 0 .888-.631 1.612-1.438 1.612"/>
</svg>
Sign in with Discord
</button>
</div>
</div>
</div>
</div>
</div>
<script src="/static/preline.js"></script>
</body>
</html>

View File

@ -0,0 +1,7 @@
import { Request, Response } from "express";
export const get = async (_request: Request, response: Response) => {
response.render("login", {
title: "Login - Relay"
});
};

View File

@ -0,0 +1,9 @@
import { Request, Response, NextFunction } from "express";
// export const ensureAuthenticated = (request: Request, response: Response, next: NextFunction) => {
// if (request.isAuthenticated()) {
// return next();
// }
// response.redirect("/login");
// };

View File

@ -0,0 +1,6 @@
import { Router } from "express";
import * as controller from "@server/controllers/login";
export const router = Router();
router.get("/", controller.get);