From 6eb7ebcefcf413002c7657d436ba20b9dbc58779 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 6 Jan 2024 17:04:57 -0800 Subject: refactor(api): move animeschedule oauth --- src/routes/api/animeschedule/oauth/callback/+server.ts | 17 +++++++++++++++++ src/routes/api/oauth/animeschedule/callback/+server.ts | 17 ----------------- 2 files changed, 17 insertions(+), 17 deletions(-) create mode 100644 src/routes/api/animeschedule/oauth/callback/+server.ts delete mode 100644 src/routes/api/oauth/animeschedule/callback/+server.ts (limited to 'src/routes') diff --git a/src/routes/api/animeschedule/oauth/callback/+server.ts b/src/routes/api/animeschedule/oauth/callback/+server.ts new file mode 100644 index 00000000..a5afa303 --- /dev/null +++ b/src/routes/api/animeschedule/oauth/callback/+server.ts @@ -0,0 +1,17 @@ +import { callback } from '$lib/oauth.js'; +import { env } from '$env/dynamic/private'; +import { env as env2 } from '$env/dynamic/public'; + +export const GET = async ({ url, cookies }) => + callback({ + url, + cookies, + cookie: 'animeschedule', + authorise: 'https://animeschedule.net/api/v3/oauth2/token', + redirect: '/settings', + client: { + id: env2.PUBLIC_ANIMESCHEDULE_CLIENT_ID, + secret: env.ANIMESCHEDULE_CLIENT_SECRET, + redirectURI: env2.PUBLIC_ANIMESCHEDULE_REDIRECT_URI + } + }); diff --git a/src/routes/api/oauth/animeschedule/callback/+server.ts b/src/routes/api/oauth/animeschedule/callback/+server.ts deleted file mode 100644 index a5afa303..00000000 --- a/src/routes/api/oauth/animeschedule/callback/+server.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { callback } from '$lib/oauth.js'; -import { env } from '$env/dynamic/private'; -import { env as env2 } from '$env/dynamic/public'; - -export const GET = async ({ url, cookies }) => - callback({ - url, - cookies, - cookie: 'animeschedule', - authorise: 'https://animeschedule.net/api/v3/oauth2/token', - redirect: '/settings', - client: { - id: env2.PUBLIC_ANIMESCHEDULE_CLIENT_ID, - secret: env.ANIMESCHEDULE_CLIENT_SECRET, - redirectURI: env2.PUBLIC_ANIMESCHEDULE_REDIRECT_URI - } - }); -- cgit v1.2.3