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>
|
||||
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>
|
|
@ -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>
|
||||
|
|
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