From dc6ba5f2c14dca8760b64b89ad62f67c6ca867d7 Mon Sep 17 00:00:00 2001 From: split Date: Mon, 8 Jul 2024 21:35:51 -0700 Subject: [PATCH] this fucking sucks i dont know how to do anything --- .env.example | 16 ++++++++++++++++ bun.lockb | Bin 53434 -> 53434 bytes src/lib/index.ts | 4 +++- src/routes/+layout.svelte | 27 +++++++++++++++++++++++++-- src/routes/+page.svelte | 12 ++++++++++-- src/routes/logout/+page.server.ts | 5 +++++ src/routes/set/+page.server.ts | 4 ++++ src/routes/set/+page.svelte | 8 ++++++++ 8 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 .env.example create mode 100644 src/routes/logout/+page.server.ts create mode 100644 src/routes/set/+page.server.ts create mode 100644 src/routes/set/+page.svelte 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 fce8e8cbf1ef1585da376ddd4a0cdd02721b87c0..cde59ebe2ae7aee94ca70ade9786836c440f992e 100755 GIT binary patch delta 848 zcmW;AD@+0b0Eh80H>QPIBr+34che0{e4X#}eZCK$r{YE=(j*ekz;^LA3z50G5eP&g zkx0CFk$BVpSAP5U^}eTi-%~%uLMqiV3*~=(jL<6T1Q?@j>V!B!XGN!t3A!bn4yISt z9(FOarc=c}X4iFUIKbS7P92As-_&W~2n|c8iDNXkbbO4^+SUm$Mtesm#0fgPI&DnQ z-P7q{dSC5f7c&PsRqSKd)~VqDbB8*09Af@Rr-36hj&+(iM)O3+#|W)cod9FB&vZhZ zpmVO%#spnQr-SJWwTE5IT|*9gr;2^dKI_zQfVmf)Iu0@K=`?VJ#;Z;f$7sIk n_!yz}t`lI4c10(wlv}ei3%~OpbBog{uV^e8%cbAVug{%7AEESZ delta 848 zcmXBID@+0b0LF2YjcH*sNMt68js)kE^L@V0_u=zY+=xV)MB*9PF5X5VGB-8?fk-40 zi5D*tnSOu2@Y}b4uNm((<3IV_Osrw#ihp_-qM29mF+$5w32=h;s!9u|=&Y%Y^pQ#xhnP85so@B-Cn|Luqj9R@VTk6LijNUm=PChC z(7sS<;S?QPrHzS8eHXi!yizG+A5+&V6&zstMx}~F%-pKfaD>@Al{${mxL5HoMAK36 zF+!`T65s^w2bC61(Roy9W8z8Q#V#hFRm#}M)Qd_52bg|Usp1ebu1XC@n0-^J;~0&1 k6%Ru+KU92-&?>0}rD9`Yez~*sxwtYn8~b0U@cp&>3oC2#UjP6A 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