From eae5d24d9e79e59a19d4721caaeaa0ca650ecb33 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sun, 1 Mar 2026 16:20:51 -0800 Subject: chore(biome): drop formatter style overrides --- src/routes/api/oauth/callback/+server.ts | 28 +++++++++---------- src/routes/api/oauth/refresh/+server.ts | 46 ++++++++++++++++---------------- 2 files changed, 37 insertions(+), 37 deletions(-) (limited to 'src/routes/api/oauth') diff --git a/src/routes/api/oauth/callback/+server.ts b/src/routes/api/oauth/callback/+server.ts index 986520f9..c5faa859 100644 --- a/src/routes/api/oauth/callback/+server.ts +++ b/src/routes/api/oauth/callback/+server.ts @@ -1,16 +1,16 @@ -import { callback } from '$lib/Utility/oauth.js'; -import { env } from '$env/dynamic/private'; -import { env as env2 } from '$env/dynamic/public'; +import { callback } from "$lib/Utility/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: 'user', - authorise: 'https://anilist.co/api/v2/oauth/token', - client: { - id: env2.PUBLIC_ANILIST_CLIENT_ID, - secret: env.ANILIST_CLIENT_SECRET, - redirectURI: env2.PUBLIC_ANILIST_REDIRECT_URI - } - }); + callback({ + url, + cookies, + cookie: "user", + authorise: "https://anilist.co/api/v2/oauth/token", + client: { + id: env2.PUBLIC_ANILIST_CLIENT_ID, + secret: env.ANILIST_CLIENT_SECRET, + redirectURI: env2.PUBLIC_ANILIST_REDIRECT_URI, + }, + }); diff --git a/src/routes/api/oauth/refresh/+server.ts b/src/routes/api/oauth/refresh/+server.ts index 13f4400c..13e7ab09 100644 --- a/src/routes/api/oauth/refresh/+server.ts +++ b/src/routes/api/oauth/refresh/+server.ts @@ -1,30 +1,30 @@ -import { env } from '$env/dynamic/private'; -import { env as env2 } from '$env/dynamic/public'; -import { redirect } from '@sveltejs/kit'; +import { env } from "$env/dynamic/private"; +import { env as env2 } from "$env/dynamic/public"; +import { redirect } from "@sveltejs/kit"; export const GET = async ({ url, cookies }) => { - const formData = new FormData(); + const formData = new FormData(); - formData.append('grant_type', 'refresh_token'); - formData.append('client_id', env2.PUBLIC_ANILIST_CLIENT_ID as string); - formData.append('client_secret', env.ANILIST_CLIENT_SECRET as string); - formData.append('refresh_token', url.searchParams.get('token') || ''); + formData.append("grant_type", "refresh_token"); + formData.append("client_id", env2.PUBLIC_ANILIST_CLIENT_ID as string); + formData.append("client_secret", env.ANILIST_CLIENT_SECRET as string); + formData.append("refresh_token", url.searchParams.get("token") || ""); - const newUser = await ( - await fetch('https://anilist.co/api/v2/oauth/token', { - method: 'POST', - body: formData - }) - ).json(); + const newUser = await ( + await fetch("https://anilist.co/api/v2/oauth/token", { + method: "POST", + body: formData, + }) + ).json(); - cookies.set('user', JSON.stringify(newUser), { - path: '/', - maxAge: 60 * 60 * 24 * 7, - httpOnly: false, - sameSite: 'lax', - secure: false - }); + cookies.set("user", JSON.stringify(newUser), { + path: "/", + maxAge: 60 * 60 * 24 * 7, + httpOnly: false, + sameSite: "lax", + secure: false, + }); - if (url.searchParams.get('redirect')) redirect(303, '/'); - else return Response.json(newUser); + if (url.searchParams.get("redirect")) redirect(303, "/"); + else return Response.json(newUser); }; -- cgit v1.2.3