Abandoned Commit
This commit is contained in:
@@ -30,8 +30,11 @@ export const POST: RequestHandler = async ({ request, fetch }) => {
|
||||
})
|
||||
if (!authResponse.ok) return new Response('Failed to authenticate', { status: 401 })
|
||||
|
||||
const authData: Jellyfin.AuthData = await authResponse.json()
|
||||
return Response.json(authData)
|
||||
const authData = await authResponse.json()
|
||||
return Response.json({
|
||||
userId: authData.User.Id,
|
||||
accessToken: authData.AccessToken,
|
||||
})
|
||||
} catch {
|
||||
return new Response('Fetch request failed', { status: 404 })
|
||||
}
|
||||
|
||||
@@ -36,15 +36,15 @@ export const actions: Actions = {
|
||||
return fail(500, { message: 'Internal Server Error' })
|
||||
}
|
||||
|
||||
const authData: Jellyfin.AuthData = await jellyfinAuthResponse.json()
|
||||
const authData = await jellyfinAuthResponse.json()
|
||||
|
||||
const serviceData: Jellyfin.JFService = {
|
||||
type: 'jellyfin',
|
||||
userId: authData.User.Id,
|
||||
userId: authData.userId,
|
||||
urlOrigin: serverUrl.toString(),
|
||||
}
|
||||
const tokenData: Jellyfin.JFTokens = {
|
||||
accessToken: authData.AccessToken,
|
||||
accessToken: authData.accessToken,
|
||||
}
|
||||
|
||||
const newConnectionResponse = await fetch(`/api/users/${locals.user.id}/connections`, {
|
||||
|
||||
Reference in New Issue
Block a user