diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..bf33140 --- /dev/null +++ b/.env.example @@ -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= \ No newline at end of file diff --git a/bun.lockb b/bun.lockb index fce8e8c..cde59eb 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/src/lib/index.ts b/src/lib/index.ts index 856f2b6..5893a83 100644 --- a/src/lib/index.ts +++ b/src/lib/index.ts @@ -1 +1,3 @@ -// place files you want to import through the `$lib` alias in this folder. +export function userAuthorize() { + +} \ No newline at end of file diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index faf8f75..e1fd901 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,5 +1,6 @@ - @@ -8,12 +9,34 @@ ava + + + \ No newline at end of file diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 5982b0a..986861d 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,2 +1,10 @@ -

Welcome to SvelteKit

-

Visit kit.svelte.dev to read the documentation

+

Hi, welcome to ava

+

+ ava is a simple avatar server. + Put an image in, get a few images out. That's it. + Nothing more, nothing less. +

+

+ If you'd like to set a profile picture, click here. + If logged out, you will be redirected to the OAuth2 provider of this instance. +

diff --git a/src/routes/logout/+page.server.ts b/src/routes/logout/+page.server.ts new file mode 100644 index 0000000..40f67e2 --- /dev/null +++ b/src/routes/logout/+page.server.ts @@ -0,0 +1,5 @@ +import { redirect } from "@sveltejs/kit"; + +export function load({}) { + throw redirect(301, "/") +} \ No newline at end of file diff --git a/src/routes/set/+page.server.ts b/src/routes/set/+page.server.ts new file mode 100644 index 0000000..0a8b1ef --- /dev/null +++ b/src/routes/set/+page.server.ts @@ -0,0 +1,4 @@ +export function load({ cookies }) { + let token = cookies.get("accessToken") + +} \ No newline at end of file diff --git a/src/routes/set/+page.svelte b/src/routes/set/+page.svelte new file mode 100644 index 0000000..7a9dcf5 --- /dev/null +++ b/src/routes/set/+page.svelte @@ -0,0 +1,8 @@ + + +

Set an avatar

+

+ Your identifier is {data.userid}. +

\ No newline at end of file