-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auth.js Middleware #52
base: main
Are you sure you want to change the base?
Conversation
|
09a9f56
to
5fadb1f
Compare
OK, I'll check it later! |
Hi @ivoilic This problem seems to be the Auth.js matter because the minimum project following will fail. |
This is not an Auth.js problem, but a config issue, see the solution explained here: nextauthjs/next-auth#6822 (comment) Here is the actual sub-module being published correctly: https://unpkg.com/browse/@auth/[email protected]/providers/github.js, https://unpkg.com/browse/@auth/[email protected]/package.json Hope this helps! 🙏 (PS: We would welcome this to be co-maintained from our official repo as |
Hi @balazsorban44 ! Thanks for your comment.
I'm sorry I doubted Auth.js! Could you check it? |
@yusukebe I tried to follow @balazsorban44's (Thanks so much for taking the time to help with this!) example and made changes at the package level. This resolved the current issue but now I'm getting the error: PS @balazsorban44 Love the idea of this being co-maintained, didn't know if it made more sense to add there or here. It would be great to have more client agnostic options for using auth.js! |
If you are fine with dropping CJS (some will argue but I recommend this), you can check out https://github.com/nextauthjs/next-auth/blob/main/packages/core/package.json Basically you only need |
Hi @ivoilic ! I've updated the jest version in the main branch. Can you merge it? After that, to avoid the error, it would be good not to use module.exports = {
testMatch: ['**/test/**/*.+(ts|tsx|js)'],
transform: {
'^.+\\.(ts|tsx)$': ['ts-jest', { useESM: true }],
},
extensionsToTreatAsEsm: ['.ts'],
} Then we cannot use import crypto from 'crypto'
// ...
globalThis.crypto = crypto And this may work. We can't test without a GitHub token, so I would like to know if there is another good way to test that doesn't use third-party tokens. |
does any one have a problem with node:internal/modules/esm/resolve:303
return new ERR_PACKAGE_PATH_NOT_EXPORTED(
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: No "exports" main defined in /Users/bruger/Documents/Github/Semester_project_trustworthy/hub_server/node_modules/@auth/core/package.json |
Hello everyone, can I take over this branch and start a new PR or is @ivoilic still available to have a look ? |
Hi!
This PR adds middleware for a Auth.js Server, it's still a WIP.
There's an issue with Jest and the @auth/core imports that's making it impossible to test currently. @yusukebe if you have suggestions please let me know.