Skip to content
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

fix(core): revert #11050 #11469

Merged
merged 3 commits into from
Jul 27, 2024
Merged

fix(core): revert #11050 #11469

merged 3 commits into from
Jul 27, 2024

Conversation

ThangHuuVu
Copy link
Member

@ThangHuuVu ThangHuuVu commented Jul 27, 2024

in #11050 we accidentally introduced a regression issue for the authorize function of the CredentialProvider. Returning null in this callback is now throwing a ConfigurationError which should not be the case.

This PR reverts the changes in #11050 and adds some tests to avoid regressing in the future.

Fixes #11074 #11190 #11428

@ThangHuuVu ThangHuuVu requested a review from 0ubbe as a code owner July 27, 2024 06:02
Copy link

vercel bot commented Jul 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 27, 2024 6:14am
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Jul 27, 2024 6:14am
proxy ⬜️ Ignored (Inspect) Visit Preview Jul 27, 2024 6:14am

@github-actions github-actions bot added the core Refers to `@auth/core` label Jul 27, 2024
Copy link

codecov bot commented Jul 27, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Please upload report for BASE (main@c188390). Learn more about missing BASE report.

Files Patch % Lines
packages/core/src/lib/actions/callback/index.ts 50.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11469   +/-   ##
=======================================
  Coverage        ?   40.02%           
=======================================
  Files           ?      179           
  Lines           ?    28682           
  Branches        ?     1258           
=======================================
  Hits            ?    11481           
  Misses          ?    17201           
  Partials        ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ThangHuuVu ThangHuuVu merged commit 0f83056 into main Jul 27, 2024
14 of 15 checks passed
@ThangHuuVu ThangHuuVu deleted the fix/revert-11050 branch July 27, 2024 13:54
k3k8 pushed a commit to k3k8/next-auth that referenced this pull request Aug 1, 2024
* fix(core): revert nextauthjs#11050

Added a test to avoid regression

* Update callback.test.ts

* Update index.ts
@BertramYe
Copy link

but thre were problem, if we use the try....catch.... to wrap the signIn function, even we can catch the error we defined, but it won't auto redirect the path we want, even we have login in with correct credentails !!!!!!

@TruongNam0301
Copy link

i still cannot handle error message to return clientSide
`import { APP_ENV } from "@/constants/env.constant";
import { type NextAuthConfig } from "next-auth";
import Credentials from "next-auth/providers/credentials";
import Google from "next-auth/providers/google";

export default {
providers: [
Google({
clientId: APP_ENV.GOOGLE_CLIENT_ID,
clientSecret: APP_ENV.GOOGLE_CLIENT_SECRET,
}),
Credentials({
async authorize(credentials) {
const payload = {
email: credentials.email as string,
password: credentials.password as string,
};
throw new Error("Email not found");
// const user = await signin(payload);
// return user ?? null;
},
}),
],
pages: {
signIn: "/login",
error: "/login",
},
secret: APP_ENV.AUTH_SECRET,
} satisfies NextAuthConfig;
`
in clientSide always return this
image

@russssl
Copy link

russssl commented Nov 12, 2024

@TruongNam0301 Same error here. No metter what error is thrown, I always get 'Configuration'

@manishoctal
Copy link

Configuration is still there.

image

@domkoder
Copy link

domkoder commented Dec 9, 2024

Configuration is still there.

image

Same thing here, any luck @manishoctal @TruongNam0301

@manishoctal
Copy link

Not yet!!

@Zhavii
Copy link

Zhavii commented Jan 3, 2025

Really?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Refers to `@auth/core`
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CallbackRouteError on Credentials when following docs
8 participants