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][error] MissingAdapter: Email login requires an adapter (firebase adapter and Resend) #10632
Comments
Hi Mabiri, I am not a maintainer but saw your issue here and want to give a heads up that
if you can try with firebase-admin 11 that might be a path forward. I am trying to raise a PR for updating to firebase-admin 12 at the moment so maybe firebase-admin 12 can work in near future. Also if you can share any more errors you are getting, does checking types maybe |
hello NickFoden , thanks for your respond , i try firebase-admin version 11.4.1 , but having the same issues .. |
Thanks for pointing this out, it looks liek this is a bug in the assertion process (checking to make sure yuo've added a database adapter) when using an email adapter and also doing the edge-runtime split config. Basically, it's checking in the edge runtime (where you don't have the adapter in the auth.js config), to ensure that the provider (resend) can operate correctly. But actually, we're not sending any emails in the middleware (edge runtime) anyway, so we can delay that checking to only happen in places where we would actually be sending an email (like in the normal serverles functions / backend / API route). I'll try to find some time and see where we can make this change. If anyone wants to take a stab that'd be great too :) EDIT: Notes for later:
|
For now, since the Email provider actually isn't doing any work in the middleware / edge runtimes where its throwing this error, you can move your Email provider to the config where you have your adapter as well, so they both don't get included in the middleware / edge runtime enviornments. That should avoid this error and still have your Resend / whatever Email provider be able to send emails and use up verificationTokens upon signin 👍 |
thanks you @ndom91 for your respond , i try mooving the Email provider the config where i have my adapter , but still i am having the same errors... |
I'm having exactly the same issue :-) Curious about a fix! |
I tried using a fake adapter in de middleware part. It won't show errors now, but resend does not work either... The import NextAuth from "next-auth";
import { Adapter, VerificationToken } from "next-auth/adapters";
import { authConfig } from "./auth.config";
const fakeEmailAdapter: Adapter = {
createVerificationToken: (verificationToken: VerificationToken) => undefined,
useVerificationToken: (params: { identifier: string; token: string }) => null,
getUserByEmail: (email: string) => null,
};
export default NextAuth({ ...authConfig, adapter: fakeEmailAdapter }).auth; |
did you find a solution ? |
Adapter type
@auth/firebase-adapter
Environment
Reproduction URL
https://github.com/tidianeb5/missing-adapter-issues-firebase-adapter-and-resend
Describe the issue
Issue Description
I'm encountering an error when trying to use email login with the next-auth package:
Configuration
I'm using the following configuration:
5.0.0-beta.15
According to the documentation, if you have an adapter that is not compatible with the Edge runtime, you need to separate the configuration into two files.
auth.config.ts
:auth.ts
(API Route):[...nextauth].ts
(API Route):middleware.ts
:Expected Behavior
I expect the email login functionality to work correctly without any errors.
Please let me know if you need any additional information or if I should provide more details about my setup or the steps I've taken to reproduce this issue.
How to reproduce
Just clone the project , and add envs :
AUTH_SECRET,SERVICE_ACCOUNT_PRIVATE_KEY,SERVICE_ACCOUNT_CLIENT_EMAIL,NEXT_PUBLIC_FIREBASE_PROJECT_ID ...
Expected behavior
Not showing the error .
The text was updated successfully, but these errors were encountered: