this fucking sucks i dont know how to do anything

This commit is contained in:
split / May 2024-07-08 21:35:51 -07:00
parent 6d6e44224e
commit dc6ba5f2c1
Signed by: split
GPG key ID: C325C61F0BF517C0
8 changed files with 71 additions and 5 deletions

16
.env.example Normal file
View file

@ -0,0 +1,16 @@
# Authentication route
OAUTH2__AUTHENTICATE=
# Logout route
OAUTH2__LOGOUT=
# Token route
OAUTH2__GET_TOKEN=
# Client id
OAUTH2__CLIENT_ID=
# Client secret
OAUTH2__CLIENT_SECRET=
# Userinfo route
USERINFO__ROUTE=
# Identifier
USERINFO__IDENTIFIER=

BIN
bun.lockb

Binary file not shown.

View file

@ -1 +1,3 @@
// place files you want to import through the `$lib` alias in this folder. export function userAuthorize() {
}

View file

@ -1,5 +1,6 @@
<script> <script lang="ts">
import "@fontsource-variable/inter" import "@fontsource-variable/inter";
export let data: { userid?: string };
</script> </script>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
@ -8,12 +9,34 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ava</title> <title>ava</title>
<style> <style>
:root {
--text: black;
--background: white;
}
body { body {
font-family: "Inter Variable", "Inter", sans-serif; font-family: "Inter Variable", "Inter", sans-serif;
max-width: 35em;
margin: auto;
color: var(--text);
}
nav {
display: flex;
gap: 1em;
justify-content: center;
margin: 1em 0;
} }
</style> </style>
</head> </head>
<body> <body>
<nav>
<a href="/">Home</a>
<a href="/set">Set avatar</a>
{#if data.userid}
<a href="/logout">Log out</a>
{/if}
</nav>
<slot /> <slot />
</body> </body>
</html> </html>

View file

@ -1,2 +1,10 @@
<h1>Welcome to SvelteKit</h1> <h1>Hi, welcome to ava</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p> <p>
ava is a simple avatar server.
Put an image in, get a few images out. That's it.
Nothing more, nothing less.
</p>
<p>
If you'd like to set a profile picture, <a href="/set">click here</a>.
If logged out, you will be redirected to the OAuth2 provider of this instance.
</p>

View file

@ -0,0 +1,5 @@
import { redirect } from "@sveltejs/kit";
export function load({}) {
throw redirect(301, "/")
}

View file

@ -0,0 +1,4 @@
export function load({ cookies }) {
let token = cookies.get("accessToken")
}

View file

@ -0,0 +1,8 @@
<script lang="ts">
export let data: { userid: string };
</script>
<h1>Set an avatar</h1>
<p>
Your identifier is {data.userid}.
</p>