lib sources restructuring

This commit is contained in:
Roman Krček
2025-07-02 23:56:11 +02:00
parent 878198fabd
commit 81e2e53cc5
19 changed files with 391 additions and 115 deletions

View File

@@ -1,6 +1,6 @@
import { redirect } from '@sveltejs/kit';
import type { RequestHandler } from './$types';
import { getOAuthClient } from '$lib/google-server.js';
import { authServer } from '$lib/google/index.js';
export const GET: RequestHandler = async ({ url }) => {
try {
@@ -17,7 +17,7 @@ export const GET: RequestHandler = async ({ url }) => {
}
// Exchange code for tokens
const oauth = getOAuthClient();
const oauth = authServer.getOAuthClient();
const { tokens } = await oauth.getToken(code);
if (!tokens.refresh_token || !tokens.access_token) {