import { createGetServerSideAuth , ServerConfig , sendConfirmAccountMailToConsole , sendForgotPasswordMailToConsole , createFaunaEmailDriver , } from "@happykit/auth-email/api" ; import { TokenData } from "." ; import { faunaClient } from "fauna-client" ; export const serverConfig = { tokenSecret : process . env . HAPPYAUTH_TOKEN_SECRET ! , cookieName : "happyauth" , secure : process . env . NODE_ENV === "production" , identityProviders : { } , triggers : { sendConfirmAccountMail : sendConfirmAccountMailToConsole , sendForgotPasswordMail : sendForgotPasswordMailToConsole , } , driver : createFaunaEmailDriver ( faunaClient ) , } ; export type AuthState = ReturnType < typeof getServerSideAuth > ; export const getServerSideAuth = createGetServerSideAuth < TokenData > ( serverConfig ) ;