this fucking sucks i dont know how to do anything

This commit is contained in:
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>
import "@fontsource-variable/inter"
<script lang="ts">
import "@fontsource-variable/inter";
export let data: { userid?: string };
</script>
<!DOCTYPE html>
<html lang="en">
@ -8,12 +9,34 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ava</title>
<style>
:root {
--text: black;
--background: white;
}
body {
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>
</head>
<body>
<nav>
<a href="/">Home</a>
<a href="/set">Set avatar</a>
{#if data.userid}
<a href="/logout">Log out</a>
{/if}
</nav>
<slot />
</body>
</html>

View file

@ -1,2 +1,10 @@
<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>
<h1>Hi, welcome to ava</h1>
<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>