diff options
| author | Fuwn <[email protected]> | 2024-02-17 21:04:59 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-02-17 21:04:59 -0800 |
| commit | f1a09f3348cf4dbc7a0fb6116f9f41fcde372f4c (patch) | |
| tree | be69710d2dbf59badb9be88a1e6dce3c710d6525 /src/routes/api/configuration/pin | |
| parent | feat(events): avatar for all events (diff) | |
| download | due.moe-f1a09f3348cf4dbc7a0fb6116f9f41fcde372f4c.tar.xz due.moe-f1a09f3348cf4dbc7a0fb6116f9f41fcde372f4c.zip | |
feat(hololive): move pinned to preferences
Diffstat (limited to 'src/routes/api/configuration/pin')
| -rw-r--r-- | src/routes/api/configuration/pin/+server.ts | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/routes/api/configuration/pin/+server.ts b/src/routes/api/configuration/pin/+server.ts deleted file mode 100644 index f813d8e8..00000000 --- a/src/routes/api/configuration/pin/+server.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { userIdentity } from '$lib/Data/AniList/identity'; -import { toggleHololiveStreamPinning } from '$lib/Database/userConfiguration'; - -const unauthorised = new Response('Unauthorised', { status: 401 }); - -export const PUT = async ({ cookies, url }) => { - const userCookie = cookies.get('user'); - - if (!userCookie) return unauthorised; - - const user = JSON.parse(userCookie); - - return Response.json( - await toggleHololiveStreamPinning( - ( - await userIdentity({ - tokenType: user['token_type'], - expiresIn: user['expires_in'], - accessToken: user['access_token'], - refreshToken: user['refresh_token'] - }) - ).id, - url.searchParams.get('stream') || '' - ), - { - headers: { - method: 'PUT', - 'Access-Control-Allow-Origin': 'https://due.moe' - } - } - ); -}; |