title: Error signing in via email (NextAuth, prisma and Amazon SES)
body: <p>I'm trying to authenticate with email using NextAuth, Prisma and Amazon SES.</p>
  <p>I got:</p>
  <blockquote>
  <p>&quot;Server Error - TypeError: email.split(...)[0].trim(...).replaceAll is
  not a function.&quot;</p>
  </blockquote>
  <p>It comes from the validation process in NextAuth <code>/node_modules/next-auth/core/routes/signin.js (58:40)</code> but I don't know why it occurs.</p>
  <p>Amazon SES seems to work fine in the console in sending smtp request.</p>
  <p>This is my code (very basic):</p>
  <pre><code>import NextAuth from 'next-auth';
  import EmailProvider from 'next-auth/providers/email';
  import { PrismaAdapter } from '@next-auth/prisma-adapter';
  import { PrismaClient } from '@prisma/client';
  
  const prisma = new PrismaClient();
  
  export default NextAuth({
    providers: [ 
      EmailProvider({
        server: process.env.EMAIL_SERVER,
        from: process.env.EMAIL_FROM,
        maxAge: 10 * 60,
      }),
    ],
    adapter: PrismaAdapter(prisma),
  });
  </code></pre>
  <p>In prisma:</p>
  <pre class="lang-js prettyprint-override"><code>
  generator client {
    provider = &quot;prisma-client-js&quot;
  }
  
  datasource db {
    provider = &quot;postgresql&quot;
    url      = env(&quot;DATABASE_URL&quot;)
  }
  
  model Home {
    id          String @id @default(cuid()) // alternatives: @default(uuid()) or @default(autoincrement())
    image       String?
    title       String
    description String
    price       Float
    guests      Int
    beds        Int
    baths       Int
    createdAt   DateTime @default(now()) 
    updatedAt   DateTime @updatedAt
  }
  
  model Account {
    id                 String  @id @default(cuid())
    userId             String
    type               String
    provider           String
    providerAccountId  String
    refresh_token      String?  @db.Text
    access_token       String?  @db.Text
    expires_at         Int?
    token_type         String?
    scope              String?
    id_token           String?  @db.Text
    session_state      String?
  
    user User @relation(fields: [userId], references: [id], onDelete: Cascade)
  
    @@unique([provider, providerAccountId])
  }
  
  model Session {
    id           String   @id @default(cuid())
    sessionToken String   @unique
    userId       String
    expires      DateTime
    user         User     @relation(fields: [userId], references: [id], onDelete: Cascade)
  }
  
  model User {
    id            String    @id @default(cuid())
    name          String?
    email         String?   @unique
    emailVerified DateTime?
    image         String?
    accounts      Account[]
    sessions      Session[]
  }
  
  model VerificationToken {
    identifier String
    token      String   @unique
    expires    DateTime
  
    @@unique([identifier, token])
  }
  
  </code></pre>