Skip to content

fix: updated token endpoint auth method to make it work with auth.js - #642

Merged
rsproule merged 8 commits into
Merit-Systems:masterfrom
sachigoyal:sachi/fix-echo-provider-authjs
Nov 3, 2025
Merged

fix: updated token endpoint auth method to make it work with auth.js#642
rsproule merged 8 commits into
Merit-Systems:masterfrom
sachigoyal:sachi/fix-echo-provider-authjs

Conversation

@sachigoyal

Copy link
Copy Markdown
Contributor

Fixed the echo provider package that was broken when paired with auth.js

here's a demo app using it: https://echo-provider-authjs.vercel.app
open sourced: https://github.com/sachigoyal/echo-provider-authjs

as the npm package isnt published yet, adding a template / docs might be misleading to end customer
we should first test this package, publish in npm, and then we can write documentation

tackles issue #598

@rsproule @fmhall can you take a look?

@vercel

vercel Bot commented Oct 30, 2025

Copy link
Copy Markdown
Contributor

@sachigoyal is attempting to deploy a commit to the Merit Systems Team on Vercel.

A member of the Team first needs to authorize it.

@rsproule

Copy link
Copy Markdown
Contributor

Let's move the repo here into templates/ name it "authjs". Then if we just update the test-publish.yml + publish-sdks.yml script to include this package, it should auto deploy itself automatically.

We need to rename it in package.json to @merit-systems/echo-authjs-provider. and Set the version to 0.0.1

@vercel vercel Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additional Comments:

packages/sdk/auth-js-provider/src/index.ts (line 49):
The import path in the JSDoc documentation comment references the old package name @merit/echo-authjs-provider instead of the new name @merit-systems/echo-authjs-provider, which will mislead developers.

View Details
📝 Patch Details
diff --git a/packages/sdk/auth-js-provider/src/index.ts b/packages/sdk/auth-js-provider/src/index.ts
index 5622dcb4..c700bbaa 100644
--- a/packages/sdk/auth-js-provider/src/index.ts
+++ b/packages/sdk/auth-js-provider/src/index.ts
@@ -46,7 +46,7 @@ function validateAppId(appId: string, context?: string): void {
  * #### Configuration
  *```ts
  * import { Auth } from "@auth/core"
- * import Echo from "@merit/echo-authjs-provider"
+ * import Echo from "@merit-systems/echo-authjs-provider"
  *
  * const request = new Request(origin)
  * const response = await Auth(request, {

Analysis

JSDoc import example references incorrect package name

What fails: JSDoc comment in packages/sdk/auth-js-provider/src/index.ts shows import from @merit/echo-authjs-provider but package.json declares name as @merit-systems/echo-authjs-provider

How to reproduce:

  1. Check JSDoc at line 49: shows import Echo from "@merit/echo-authjs-provider"
  2. Check package.json at line 2: shows "name": "@merit-systems/echo-authjs-provider"
  3. Verify templates/authjs/src/auth/index.ts correctly imports from @merit-systems/echo-authjs-provider

Result: Documentation shows wrong import path, misleading developers to import from non-existent old package name

Expected: JSDoc should show correct import path matching the actual package name in package.json to ensure developers use the right import statement

@sachigoyal
sachigoyal force-pushed the sachi/fix-echo-provider-authjs branch from cb0a551 to b9f6c41 Compare October 31, 2025 07:17
@sachigoyal

Copy link
Copy Markdown
Contributor Author

@rsproule updated the ci/cd pipelines, added the template and updated docs
after its merged, and npm package is published, you can deploy the template in vercel in this domain https://echo-authjs.vercel.app as its mentioned in data.tsx

@rsproule rsproule left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove the one bit from the echo app. Otherwise LGTM.

@sachigoyal
sachigoyal requested a review from rsproule October 31, 2025 19:09
Comment thread templates/authjs/.env.local
@sachigoyal

Copy link
Copy Markdown
Contributor Author

@rsproule let me know if there are any changes needed. otherwise feel free to merge it

@rsproule
rsproule merged commit bb82a5f into Merit-Systems:master Nov 3, 2025
5 of 19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants