aboutsummaryrefslogtreecommitdiff
path: root/src/routes/api/animeschedule/oauth/callback
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-01-06 17:04:57 -0800
committerFuwn <[email protected]>2024-01-06 17:04:57 -0800
commit6eb7ebcefcf413002c7657d436ba20b9dbc58779 (patch)
tree4d585cff4f7a8eb42ff4732de432034d515cb908 /src/routes/api/animeschedule/oauth/callback
parentfeat(api): myanimelist oauth (diff)
downloaddue.moe-6eb7ebcefcf413002c7657d436ba20b9dbc58779.tar.xz
due.moe-6eb7ebcefcf413002c7657d436ba20b9dbc58779.zip
refactor(api): move animeschedule oauth
Diffstat (limited to 'src/routes/api/animeschedule/oauth/callback')
-rw-r--r--src/routes/api/animeschedule/oauth/callback/+server.ts17
1 files changed, 17 insertions, 0 deletions
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
+ }
+ });