import { Mail } from 'lucide-react'
import type { AuthProvider } from './_types'

/**
 * Email + password via @pikku/auth-js credentials provider.
 * The backend route is POST /auth/callback/credentials.
 * Login is handled by the /login form directly.
 */
export const credentials: AuthProvider = {
  id: 'email',
  labelKey: 'auth:providers.email',
  Icon: Mail,
  tone: 'primary',
  envVars: ['AUTH_SECRET'],
  login: () => {
    window.location.href = '/login'
  },
}
