From 29d05aadb01aa9604839bf5948f578754bb81246 Mon Sep 17 00:00:00 2001 From: Maksim Date: Fri, 4 Oct 2024 12:35:48 +0300 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20(auth-js):=20update=20@aut?= =?UTF-8?q?h/core=20dependency=20from=20version=20^0.30.0=20to=20^0.35.3?= =?UTF-8?q?=20for=20latest=20features=20and=20bug=20fixes=20=E2=9C=85=20(i?= =?UTF-8?q?ndex.test.ts):=20add=20basePath=20to=20config=20for=20consisten?= =?UTF-8?q?cy=20in=20authentication=20tests=20=E2=99=BB=EF=B8=8F=20(index.?= =?UTF-8?q?test.ts):=20correct=20code=20style=20inconsistencies=20for=20be?= =?UTF-8?q?tter=20readability=20and=20maintainability?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/auth-js/package.json | 2 +- packages/auth-js/test/index.test.ts | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/auth-js/package.json b/packages/auth-js/package.json index 431d33b3d..f2dc1b84f 100644 --- a/packages/auth-js/package.json +++ b/packages/auth-js/package.json @@ -57,7 +57,7 @@ "react": ">=18" }, "devDependencies": { - "@auth/core": "^0.30.0", + "@auth/core": "^0.35.3", "@types/react": "^18", "hono": "^3.11.7", "jest": "^29.7.0", diff --git a/packages/auth-js/test/index.test.ts b/packages/auth-js/test/index.test.ts index 35fe182ae..1199bead8 100644 --- a/packages/auth-js/test/index.test.ts +++ b/packages/auth-js/test/index.test.ts @@ -3,7 +3,7 @@ import { skipCSRFCheck } from '@auth/core' import type { Adapter } from '@auth/core/adapters' import Credentials from '@auth/core/providers/credentials' import { Hono } from 'hono' -import { describe, expect, it, vi } from "vitest" +import { describe, expect, it, vi } from 'vitest' import type { AuthConfig } from '../src' import { authHandler, verifyAuth, initAuthConfig, reqWithEnvUrl } from '../src' @@ -39,6 +39,7 @@ describe('Config', () => { '/*', initAuthConfig(() => { return { + basePath: '/api/auth', providers: [], } }) @@ -78,7 +79,7 @@ describe('Config', () => { }) }) -describe('reqWithEnvUrl()', async() => { +describe('reqWithEnvUrl()', async () => { const req = new Request('http://request-base/request-path') const newReq = await reqWithEnvUrl(req, 'https://auth-url-base/auth-url-path') it('Should rewrite the base path', () => { @@ -126,7 +127,6 @@ describe('Credentials Provider', () => { password: {}, }, authorize: (credentials) => { - if (credentials.password === 'password') { return user } @@ -193,12 +193,12 @@ describe('Credentials Provider', () => { it('Should respect x-forwarded-proto and x-forwarded-host', async () => { const headers = new Headers() - headers.append('x-forwarded-proto', "https") - headers.append('x-forwarded-host', "example.com") + headers.append('x-forwarded-proto', 'https') + headers.append('x-forwarded-host', 'example.com') const res = await app.request('http://localhost/api/auth/signin', { headers, }) let html = await res.text() expect(html).toContain('action="https://example.com/api/auth/callback/credentials"') }) -}) \ No newline at end of file +})