Security fixes to lib files

This commit is contained in:
Roman Krček
2025-07-03 00:02:35 +02:00
parent 81e2e53cc5
commit 6debb8a7ce
11 changed files with 55 additions and 23 deletions

View File

@@ -1,6 +1,6 @@
import { json } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
import { authServer } from '$lib/google/index.js';
import { getOAuthClient } from '$lib/google/server.js';
import { google } from 'googleapis';
export const GET: RequestHandler = async ({ request }) => {
@@ -14,7 +14,7 @@ export const GET: RequestHandler = async ({ request }) => {
const accessToken = authHeader.slice(7);
// Create OAuth client with the token
const oauth = authServer.getOAuthClient();
const oauth = getOAuthClient();
oauth.setCredentials({ access_token: accessToken });
// Call the userinfo endpoint to get user details