this fucking sucks i dont know how to do anything
This commit is contained in:
parent
6d6e44224e
commit
dc6ba5f2c1
16
.env.example
Normal file
16
.env.example
Normal 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=
|
|
@ -1 +1,3 @@
|
||||||
// place files you want to import through the `$lib` alias in this folder.
|
export function userAuthorize() {
|
||||||
|
|
||||||
|
}
|
|
@ -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>
|
|
@ -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>
|
||||||
|
|
5
src/routes/logout/+page.server.ts
Normal file
5
src/routes/logout/+page.server.ts
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
import { redirect } from "@sveltejs/kit";
|
||||||
|
|
||||||
|
export function load({}) {
|
||||||
|
throw redirect(301, "/")
|
||||||
|
}
|
4
src/routes/set/+page.server.ts
Normal file
4
src/routes/set/+page.server.ts
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
export function load({ cookies }) {
|
||||||
|
let token = cookies.get("accessToken")
|
||||||
|
|
||||||
|
}
|
8
src/routes/set/+page.svelte
Normal file
8
src/routes/set/+page.svelte
Normal 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>
|
Loading…
Reference in a new issue